How to run a Go IDE on your Smart TV or WebOS device.

My mac died recently. Although I was unemployed at the time, I still enjoyed spending most of my days working on pet projects. One notable project was the Plantix code challenge. This challenge tested programming skills and required working on their python API client. I took on the challenge to see if my remaining devices would be up to the task. I did succeed in proving this but I failed the interview nonetheless. What I learned is that there is growing support for certain programming languages on mobile platforms. I was able to write a python function and test it with just my phone. Android has an application called TermUX, that works as a full-featured Linux environment with a package manager.

1. Install TermUX

Head over to the Google Play store and install TermUX. The application should look like this:

Once the download is complete, open the terminal and install Golang with command :

pkg install golang

Here’s a screenshot of the install log

Once that is complete, the next step would be to install the web based ide. This can be done with :

go get github.com/thestrukture/ide

After installation, change your working directory to :

cd ~/go/bin

Within this folder you’ll find an executable named ide. Prior to launching, run the following commands in the screenshot below:

The ide will download any remaining binaries needed to function. Notice how the program is ran with a relative path. GoS is an abbreviation of GopherSauce.

Now that IDE is running and listening on port 8884 of your device, it’s time to spread the love on bigger displays. My choice was WebOS. To get your IP go to your connection settings, click on the WIFI SSID you’re currently connected to. The screen should show your local IP address. Pair this address with port 8884 to access the IDE.

For mouse and keyboard support, just connect it with your smart device. In this case, I connected a USB mouse and keyboard to a smart TV. For devices without USB support, a Bluetooth mouse and keyboard will work as well.

All of the javascript aspects work smoothly as well. TermUX has an isolated filesystem, rendering the rest of your data on your phone inaccessible.

The greatest benefit of this is you’ll have to move less weight around by not requiring a computer at all times. Imagine just using your smart devices as a web server and development environment. It’s also to entice smart device holders to get into programming without the commitment of buying a high-end computer. The IDE has a small memory footprint of about 8 mb at idle times. It works like a charm on smart devices thanks to hardware acceleration. The strukture IDE utilises a virtual terminal to run any command on its terminal. This means that anything you have preinstalled on TermUX will be available on the IDE’s built in terminal.

In favor of this article, I wrote, developed this entire article on my smartphone.

Support the project : https://opencollective.com/thestrukture