Adding BBB Support For Kotlin Native

Greetings. I am a Kotlin community member that is working on adding BBB support for Kotlin Native and need some help with the following:

  • Selecting a suitable toolchain that will work on Ubuntu, Linux Mint, and possibly Debian (hosts) for cross compilation to the BBB
  • Setting up a sysroot (libraries, config files to include etc)
  • What C libraries to use with the toolchain (if applicable)
  • Standard C library to use for the embedded side (for use in a “Blinky” Kotlin Native sample program on the BBB side)
  • Hosting for the Kotlin Native BBB toolchain and sysroot (stored as tar.gz files)

Now for a bit of background Kotlin Native uses the Kotlin programming language, and LLVM for developing native programs (executables) that work on multiple platforms (Linux x86-64, Mac OSX, ARM Cortex A SBC’s etc) without a virtual machine. Currently there is automatic reference counting for automatic memory management (no GC implemented), and manual memory management can also be used. Interoperability is available for C (not C++) libraries, which has a partial reliance on libffi. There are some Kotlin Native samples available with the most sophisticated one being a Tetris game which uses the SDL library.

The Kotlin programming language was created by JetBrains (the company that sells tools like PyCharm and IntelliJ). Andrey Breslav is the language founder who named Kotlin after Kotlin Island near Saint Petersburg, Russia. Kotlin is designed to be a programmatic (industrial), Object Orientated (is multi paradigm) programming language, which is fully inter-operable with Java (Kotlin JVM only), and is open source (Apache 2). Average time for learning Kotlin is around 3 days, although some people can pickup Kotlin in a few hours. Main areas where Kotlin is used are Android, and server side (especially micro web services) development. You might be interested in listening to some Talking Kotlin podcasts which cover other areas where Kotlin has been used.

Would be highly appreciated (also grateful) by the Kotlin Native team if the Beaglebone Foundation could send a BBB to JetBrains in order to ensure that Kotlin Native properly supports the BBB. Important to note that Kotlin is split into three platforms:

  • Kotlin JVM (Kotlin on the Java platform)

  • Kotlin JS (Kotlin on the web)

  • Kotlin Native (Kotlin on native platforms without a virtual machine)

Greetings. I am a Kotlin <https://kotlinlang.org/> community member that
is working on adding BBB support for Kotlin Native
<https://github.com/JetBrains/kotlin-native> and need some help with the
following:

   - Selecting a suitable toolchain that will work on Ubuntu, Linux Mint,
   and possibly Debian (hosts) for cross compilation to the BBB

This may depend on the Linux image you're using one the given Beaglebone.
For kernels 3.8.x, the beaglebone used Wheezy, and we're pretty much stuck
with gcc 4.6.3. For Debian Jessie, it seems 4.9.2 is used. Currently. For
the sake of sanity, and ease of use / setup. You may wish to stick with
Ubuntu. As at least for Ubuntu 14.04 lts, there were a plethora of cross
compiler packages available. gcc 4.9.x may be post 14.04, but you should
check. In any case, once you have the right version of Ubuntu, it's a
simple matter of using APT to install the correct toolchain for the
Beaglebone. ABI used is of course armhf. Also known as "hard float".

   - Setting up a sysroot (libraries, config files to include etc)

Refer to your nearest gcc reference book.

   - What C libraries to use with the toolchain (if applicable)

For what ?

   - Standard C library to use for the embedded side (for use in a
   *"Blinky"* Kotlin Native sample program on the BBB side)

STD Linux API calls on the right file will get the job done. However,

/dev/mem + mmap() can also be used, but is really out of the scope of the
novice / beginner.

   - Hosting for the Kotlin Native BBB toolchain and sysroot (stored as
   *tar.gz* files)

github ?

Now for a bit of background Kotlin Native uses the Kotlin programming
language, and LLVM <http://llvm.org/> for developing native programs
(executables) that work on multiple platforms (Linux x86-64, Mac OSX, ARM
Cortex A SBC's etc) without a virtual machine. Currently there is automatic
reference counting for automatic memory management (no GC implemented), and
manual memory management can also be used. Interoperability
<https://github.com/JetBrains/kotlin-native/blob/master/INTEROP.md> is
available for C (not C++) libraries, which has a partial reliance on
libffi <https://sourceware.org/libffi/>. There are some Kotlin Native
samples <https://github.com/JetBrains/kotlin-native/tree/master/samples>
available with the most sophisticated one being a Tetris
<https://github.com/JetBrains/kotlin-native/tree/master/samples/tetris>
game which uses the SDL <https://www.libsdl.org/> library.

The Kotlin programming language was created by JetBrains
<https://www.jetbrains.com/> (the company that sells tools like PyCharm
<https://www.jetbrains.com/pycharm> and IntelliJ
<https://www.jetbrains.com/idea>). Andrey Breslav is the language founder
who named Kotlin after Kotlin Island
<https://en.wikipedia.org/wiki/Kotlin_Island> near Saint Petersburg,
Russia. Kotlin is designed to be a programmatic (industrial), Object
Orientated (is multi paradigm) programming language, which is fully
inter-operable with Java (Kotlin JVM only), and is open source
<https://github.com/JetBrains/kotlin> (Apache 2). Average time for learning
Kotlin <http://kotlinlang.org/docs/kotlin-docs.pdf> is around 3 days,
although some people can pickup Kotlin in a few hours. Main areas where
Kotlin is used are Android, and server side (especially micro web services)
development. You might be interested in listening to some Talking Kotlin
<http://talkingkotlin.com/> podcasts which cover other areas where Kotlin
has been used.

Would be highly appreciated (also grateful) by the Kotlin Native team if
the Beaglebone Foundation could send a BBB to JetBrains in order to ensure
that Kotlin Native properly supports the BBB. Important to note that Kotlin
is split into three platforms:

Forgive me for saying so. But don't you think you should be purchasing your
own boards if *you* want to do something for the community ? Especially if
you plan on profiting from the result.

Linux Mint uses the same back-end (general infrastructure/software) as Ubuntu. So Ubuntu 14.04 is the base for Linux Mint 17, Ubuntu 16.04 is the base for Linux Mint 18 for instance. No need to switch from Linux Mint to Ubuntu since Linux Mint has a reputation for being the most user friendly/reliable Linux Desktop distribution. GitHub isn’t the best place to host large binary files.

I already have my own BBB for testing, why would I want another one? All development I am doing to add BBB support for Kotlin Native isn’t commercially motivated, if anything it is for the benefit of the entire Kotlin community. Is there an issue with contributing to the community for non-commercial gain?