How to build cobalt as a shared library? - cobalt

I want to integrate cobalt as a browser in my project.The plan is to do this by having cobalt as a shared library. A detailed explanation would be appreciated.
My specific question would be as to how can i build the cobalt browser as a shared library.

The easiest way to integrate Cobalt in another binary is to rename main() function from your Starboard implementation (I'm assuming your OS is POSIX-like) into something like cobalt_main() and change the type in cobalt target (located in cobalt/browser/cobalt.gyp) to shared_library. Deeper integrations will require more effort.
I'm not quite sure if you even need to build Cobalt as a shared library. Perhaps you can simply run the same Cobalt binary but point it to another app?

Related

Does go supports in MCU?

I have explored, does Go support on Micro Controller Unit. Got some info that is TinyGo. Have doubt is TinyGo equivalent to Golang which support in Linux.
The short answer: Yes, when using TinyGo.
The long answer:
As of the time writing TineGo directly supports more than 70 different microcontroller boards. And about 65 different peripheral devices.
TinyGo is a new Compiler, which is written in Go that consumes normal Go code. It also makes use of the LLVM compiler toolchain to be able to emit the binaries needed for microcontrollers.
Using TinyGo you can shrink a simple HelloWorld program from ~1MB binary size to about 480 bytes on an Arduino UNO.
TinyGo has reimplemented large parts of the Go standard libary, but not everything.
Check out this site for more details on the support of std libraries.
IDE Integration:
In order to achieve a nice developer experience, the TinyGo Team does also provide a VSCode Extension, which provides functionality to switch the context to your currently used board. That way the go language server and intellisense etc. are enabled to help you out while coding.
Also Jetbrains is working on a Goland Extension, which provides atleast the same functionality as the VSCode extension, if not even a little bit more.
Summary:
TinyGo is not yet an in place replacement for Go, but you can already build really great things using TinyGo. If you want to start with microcontroller projects and want to use Go then chose TinyGo.

How to create an embeddable C-API library in Go?

I am planning to write a cross-platform app that has most of its functionality shared across all platforms (Linux, OS X, Windows, iOS, Android).
These are mostly helper function (calculations, internal lists, networking etc.) so I figured it would be convenient to have those functions in a library I can compile for every platform while still being able to create custom UI for each platform individually.
Dominant languages across those platforms I mentioned are C, Objective-C, C# and Java. All these languages support calling C-API functions from a library either directly or via internal wrappers. Since I don't want to write 80% of my application's code in C/C++, I searched and found Go.
cgo seems to be the solution for my problem.
My current thought is to code the core library in Go and then compile it for each platform, however, invoking go build does not create anything at all.
I import "C".
I have declared a func and added the //export statement before.
I read about gccgo but people keep pointing out that it is outdated and should not be used.
Maybe anyone can point out a flaw in my thoughts or help me bring this library file together. Thanks in advance.
If your aim is to build a library that can be linked into arbitrary C, Objective-C or Java programs, you are out of luck with the currently released standard tool chain. There are plans to change this in the future, but at present the Go runtime is not embeddable in other applications.
While cgo will allow you to export functions to be called from C, this is only really useful for cases when the C code you call from Go needs to call back to Go.

Do I really need an OpenCL SDK?

I just tried to make myself familiar with OpenCL but totally got confused when everyone in the Internet was talking about downloading a Vendor specific OpenCL SDK. Why would I need that?
My understanding of using OpenCL was the following:
Download the OpenCL header files that are maintained by Kronos in the Khronos OpenCL Registry and make it available to your compiler.
Compile your code and link against the OpenCL.dll.
The reason why it confuses me is because I thought that OpenCL should abstract away vendor specific implementations. If I now download a Vendor specific SDK isn't then this advantage destroyed?
Can someone please make this clear?
Your understanding is absolutely correct - you do not need any vendor SDKs in order to develop or run OpenCL programs. All you need are the headers and a library to link against. The vendor SDKs provide sample code that may be useful to look at while you are learning how to use OpenCL, and they may also provide tools that can aid development.
On Windows, you will need an OpenCL.lib library to link against, which the SDKs do provide. You can download the sources for this library and build it yourself if you wish.
There is no harm from using a specific vendor's SDK however. The headers and library that they provide in the SDK should just be the stock Khronos versions that you can download yourself. This means that an OpenCL application built using one vendor's SDK will still run just fine against other vendors' devices.

Is Golang's Revel able to be deployed as binary?

One of my concern about writing Web Apps using non-compiled language (Ruby, PHP, Javascript (server side), etc) is my source code can be copied and modified by another person and then they could sell it, claim it as their own. I'm seeking another language to develop my next project, and find that Go + Revel is quite promising in term of speed and feature (error line, hot code-reload)
The question is, is revel support deployment as binary?
Golang being a compiled language, everything you do with it is a binary.
What is losing you here is the hot-reload functionnality: even with it, you are still using a binary, but Revel is watching the source and compiling it again when needed.
So yes, an application written in Golang with Revel is a binary.

Fastest/easiest way to build a WebKit based Windows application?

I am a web developer. I don't know how to build native Windows applications. I recently built a Mac desktop application (using MacRuby) which is a WebKit wrapper around one of my web applications. I'd like to do the same thing for Windows (preferably in Ruby, but whatever is easiest).
Since this is not the core of the application, I'd rather not spend a lot of time trying to build and maintain it. I just need a Windows application that can:
Open a specific website on application launch using an embedded WebKit WebView
Trigger Growl notifications via JavaScript (with some sort of named bridge)
What is the easiest, fastest, cleanest way to do this?
Update: So far I've come across some frameworks like Qt and Awesomium. I don't know how these frameworks compare to other options available, so if you have any opinions or advice, I would appreciate it.
Check out http://appjs.org/ it's built with NodeJS at its core! And it uses chromium webkit at it's core :D
Well, this is a very old question, but if you are still interested...
I'd recommend Qt. There are some very good books available with a lot of boilerplate code and wizard-type tools. You will be able to find example code demonstrating the embedded Webkit that you can modify to suit your needs. It is free and redistribution is free (last I knew). You won't have to know anything about native Windows development, nor even use any native Windows dev tools.
Good luck!

Resources