Roads Less Taken

A blend of programming, boats and life.

Nim Meets Arduino

| Comments

I now work as the Team Lead at Evothings and our open source product is a Workbench for creating mobile HTML5 applications focused on IoT, by editing and running them live on the mobile device inside our spiced up Cordova based “Evothings Viewer”.

I am of course partial here - but the tool is really easy to use, doesn’t force you into any specific framework or editor, enables a very quick development cycle and has tons of examples, tutorials, docs and some special IoT focused libraries like for example around BLE (Bluetooth Low Energy). You can have your code running on your phone literally within 1-2 minutes and you don’t need to install XCode or the Android tools, you can even run it just fine from your trusty Linux laptop! Just go for it. Ok, enough of the sales talk…

Since we are specializing in the IoT space we have our office filled to the brink with toys… eh, I mean IoT devices of all kinds from all different vendors. Two IoT communication standards are particularly important in this space, and that’s BLE and MQTT. I have already written three blog posts around MQTT using Evothings. Now I am instead focusing on BLE and particularly the embedded device side of the story.

This led me to round up a bunch of devices at the office that are fairly technically capable and have BLE support. The one I selected was the LinkIt ONE development board from MediaTek & Seeed Studio. It’s an insanely feature packed little board (GSM/GPRS, GPS, Wifi, BLE, sound output, SD card) with decent computing power (ARM7 EJ-S, 16Mb flash, 4Mb RAM) while still remaining in the “medium” embedded space I would say, still ruling out plain Linux and regular tools. I consider the Raspberri Pi or C.H.I.P and similar machines to be in the “large” embedded space, they are real computers and you can basically use whatever you like to develop on those.

The medium and small devices can be programmed using for example Espruino or Micropython (two very interesting projects) but in many cases, for more demanding applications, C/C++ is still king simply because of size and performance advantages. And also the fact that hardware vendor SDKs are typically in C/C++. But could there be an alternative language out there?

  • A language that is just as fast and small that easily can use all these C/C++ SDKs?
  • A language with a syntax similar to Python made to be easy to write and read?
  • A language with soft realtime GC and a sane advanced type system with generics?
  • A language with a good standard library and friendlier than C++?
  • A language with compile time hygienic AST based macros written in the language itself?
  • A language offering an imperative style and not forcing OO if you don’t want to?

Yep! Read on to find out…

Evothings + Phoenix = Neato

| Comments

I have just started working at Evothings!

It’s a fun gang making slick development tools and libraries for building mobile IoT apps. Evothings is pushing the envelope on really easy mobile development focused on all the new nifty IoT-devices flooding us over the next few years.

In my last article I predicted Elixir to become big and now that I am learning the Evothings tools I wanted to make an Evothings example that uses Phoenix, the Elixir web server framework, as a backend, using its channels mechanism for websocket communication.

Coinciding with the release today of Evothings Studio 2.0 beta 2 (yay!) I will show step-by-step how to:

  1. Install Evothings Studio locally. It’s just unpacking a zip :)
  2. Make sure we can run the “BLE Scan” example app and modify it.
  3. Get a Phoenix server up on a Debian/Ubuntu server on the internet.
  4. Modify the app and server to use Phoenix channels for publish/subscribe of scan data.
  5. Verify it all works!

Since not everyone has a Linux server up on the internet you can skip step 3 and just use my public server :)

Let’s go!

Elixir Booming

| Comments

It seems like the “damp cloth of Java” that has been plastered all over the programming landscape the last 20 years is finally being lifted. I admit, I do dislike Java …immensely. And not only on technical grounds, but even more based on what I perceive as it’s community worshipping complexity for it’s own sake. Of course IMHO.

These days new and truly interesting languages are all over the place. Rust and Go are two examples with a lot of momentum, although I personally choose Nim over both.

And Smalltalk is still my “super productive dynamically typed” language of choice, but I just learned about a language that I really think is going places…

Adding Objects to Ni!

| Comments

So… Ni has almost reached the point where I can see objects appearing. The following describes the design I currently have in mind, read it and tell me what you think so I can scrap it and start over ;)

Ni Design Decisions!

| Comments

So… my little Ni language got some attention since it was first on Hackernews, then TheRegister, all over Twitter and also Reddit.

But I think it managed to come relatively unscathed out of it, although it REALLY is pre-alpha-not-even-complete-eats-your-harddrive early and you know, I really have no idea if it ever will go the distance since it takes quite a bit of work to get a language to actually be used. But I am going to stick with it.

Anyway, I have been experimenting with “arg words” and “lookup scoping” while thinking about how to add objects, and a few other things. This article doesn’t introduce how I want to do objects, but the next one does (I split it in two). This article however covers a bunch of loose ends and my ideas on how to tackle them in Ni. And I will try to make this understandable even if you don’t know Ni. ;)