Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

kotlin-native on arduino #1229

Closed
ghost opened this issue Jan 14, 2018 · 10 comments
Closed

kotlin-native on arduino #1229

ghost opened this issue Jan 14, 2018 · 10 comments

Comments

@ghost
Copy link

ghost commented Jan 14, 2018

based on this

  • iOS applications (reusing code with Android)
  • Embedded systems/IoT (e.g., Arduino and beyond)

I wondered if there is progress?

Just read that avr-llvm was merged into the main tree some months ago and Kotlin-Native on iOS is already working.

thanks

@StefMa
Copy link
Contributor

StefMa commented Jan 14, 2018 via email

@msink
Copy link
Contributor

msink commented Jan 14, 2018

Currently Kotlin/Native application require at least 200-300 kilobytes of memory - will not fit in arduino, needs something like stm32f4.

@olonho
Copy link
Contributor

olonho commented Jan 15, 2018

Yes, embedded targets are being worked on, however AVR-based Arduino are too low end from both CPU and memory standpoints.

@MRezaNasirloo
Copy link

Golang is already on 34 different platform including arduino uno with 2KB of SRAM. I hope you guys figured out soon 👍

@ghost
Copy link
Author

ghost commented Mar 30, 2018

golang is not on Arduino, gobot only talks to Arduino but does not run on Arduino, otherwise that would be nice as well but does not seem to be feasible.

@Arkuda
Copy link

Arkuda commented Jul 12, 2019

So, if use esp8266/esp32 you can try join https://github.com/olonho/carkot/tree/master/translator and https://www.esp32.com/viewtopic.php?t=9226
(for short: first its a kotlin to llvm translator, second its a llvm for esp8266/esp32)
But, its very hard.

@thawkins
Copy link

Go on ardunio uno using llvm

https://github.com/tinygo-org/tinygo

@msink
Copy link
Contributor

msink commented Jul 19, 2019

It supports ARM based microcontrollers and WASM, same as Kotlin/Native already did year ago.

Hm, for AVR it uses avr-gcc for linking.

@carlos4242
Copy link

FYI, Go (https://github.com/tinygo-org/tinygo), Swift (https://www.swiftforarduino.com) and Rust work on Arduino UNO and other AVR 8 bit microcontroller based boards, although they are of course much more limited in resource usage than on larger platforms. I wrote Swift for Arduino, I know Ayke who wrote TinyGo and the AVR rust/AVR llvm team (Dylan and others) plus I helped write a little of the AVR back end, so I'm fairly familiar with the issues. I am not experienced with Kotlin. My guess is, like those three existing languages for Arduino UNO, the challenge would be fitting standard libraries into the constrained resources of the device. With S4A I had to do a lot of careful work to get standard features to fit. It's definitely possible to get the language principles to work though, Kotlin is a compiled language in this paradigm and from what I know, is quite similar to Swift in many ways so it should be possible to make efficient code.

@sbogolepov
Copy link
Contributor

Hello everyone!
It's unlikely that Kotlin team will work on Arduino support in the foreseeable future. The reason is simple: we have only so many resources :)
However, we have some ideas about refactoring compiler and surrounding tooling to make it extensible, so users could experiment with their own targets without much hassle. But this refactoring is big and touches many parts of Kotlin project (compiler, Gradle plugin, cinterop, kotlinx.libraries, etc.).
So before starting to work on such tremendous task we need to understand do our users really need such feature and how flexible it should be. That's why we created KT-43974.

According to #4079 I'm closing this issue. Feel free to create a new issue on YouTrack or add your use-case to KT-43974.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants