Tuesday, 14 January 2014

Half way through my 60 Days of Things

I'm now half way through my 60 Days of Things. I started this blog on the 14th of December last year, without intending to blog every day. But I happened to have something to say every day, and once I'd established that regularity, I decided to keep it up. I do have rather a lot to say about the Object Net, and my other blog is full of me saying it in long posts. This way I get to write shorter posts, yet more often.

So, looking back at what I've blogged: here are articles describing the development progress in NetMash:

I also wrote some more philosophical and background articles on the Object Network for AR and the IoT:

And I showed off some hardware:

In the next 30 days .. well, you'll just have to stay tuned!

Monday, 13 January 2014

The Functional Observer Programming and Distribution Model

I thought I'd pick up on the final two paragraphs in my recent post on Monads, where I described an alternative approach to using them: simply accept objects and their states, and then have pure functional transitions between those states.

This approach is the basis of the programming and distribution model I call "Functional Observer". Functional Observer is the foundation of the Object Network.

In Functional Observer, an object may observe other objects through links. When an observed object's state changes, the observer object may change its own state. That new state is a pure function of the new state of the observed object, the states of other linked objects, and the current state of the observer.

Below is an example in a picture: there's a Ticket object linking to its corresponding Order object. For a given state of the Ticket and the linked and observed Order, the Ticket's next state is a pure function of those two visible states:
State can be either pulled when needed, or pushed when updated.

Functional Observer is the basis of FOREST (Functional Observer REST), the Object Network's distribution model, and of Cyrus, its native programming language.

I'll be elaborating more on this family in future posts.

Sunday, 12 January 2014

Linking Things up: from house to street to city to the world

Yesterday I referred to the way that, with the Object Network, you could have a link to a grandparent's house, or rather its virtual places, from yours, so that you could navigate virtually there just like you can navigate around your own house, checking on the lights and locks and perhaps medical sensors.

This only needs a URL - say from your hallway place object to their hallway place object. You could walk to your own hallway holding up the AR view, then carry on walking on the screen right into the grandparent's house to see that everything was all right.

Actually, you could link to the council-provided street object, and then either physically or virtually go out into the street. You could read a note telling you when the next recycling collection was due. Not IoT, more abstract-virtual than real Things. But the Object Net doesn't distinguish between them. There could also be actual public or council-run Things, perhaps to do with lighting or traffic sensors.

Of course, other folk out in the street looking around would be visible to you, and you could chat if you were friendly.

Maybe if you looked back at their houses, you'd see, not their private IoT network, but a set of publically-visible places, perhaps advertising some event or hobby or interest. Or virtual seasonal decorations, that sync up with the real Things.

If you walked, in reality or virtually, into town, you would be met by ongoing links coming out from the places you've been to, or new ones advertised by beacons you pass. You've seen all the examples of course, of how shops and art galleries could be augmented. But in the Object Net, they can be linked up, too.

In fact, the Object Net can form a seamless, global network of Things all linked up. No silos, not even any "applications". It will be an unbroken fabric of linked-up real and virtual objects that surrounds you everywhere you go.

It's not just a static "read-only" fabric either: it's interactive. You could be allowed to leave notes for friends in certain places, and you'd be able to pick up a link to anything you see and then plonk it down anywhere you are allowed to.

When entering the park on your bike, you could grab the link of a notice telling you today's park closing hours, and attach it to your virtual wall at home, ready to read it when you return, simply by holding up your AR view on your phone to the real wall.


Saturday, 11 January 2014

The Person as a First Class Object or Thing

Following on from my post a couple of days ago, I'd like to elaborate a little more on the relationship between Augmented Reality and the Internet of Things within the Object Network. I alluded to the fact that the IoT can naturally embrace AR, and this is particularly true in the Object Net, because there, a person is just another "Thing"!

In fact, you've hopefully seen my 3D screenshots of a place with lights and a light sensor. Well, here is what another person using NetMash in the same room looks like:



OK, a little basic, and slightly unnerving, for an avatar, but that's just detail at this stage.. This was me visiting the room using NetMash on my daughter's phone, to be precise.

To the Object Net IoT, the user object is not so different from a light or switch: it has a URL and both sensor and actuator elements. The sensors include: GPS location, BLE location, orientation, currently looking at, currently touching or gesturing, currently saying, etc. Even heart rate and other Quantified Self parameters could be added to the user object. The actuators include: screen - tablet or glasses; gui or 3D; camera background, wall screens; sounds and vibrations, etc.

Instead of just interacting in the rather limited way that other IoT approaches afford: directly with the actual lights and switches and via apps with dedicated GUIs, the point of an AR interface in the Object Net is to make the user a first class player in its IoT, able to interact within the same logical space as any and all other Things together, to explore, observe and to act and interact just like them.

The user gets to move around and see everything there is to see about the surrounding Things at a rich, logical level - their full internal state, the links between them, their animation rules. A user can interact in a more complete, seamless and more consistent way than directly with the physical Things themselves.

Being first class also means that users can themselves be treated just like any other Thing - by lights, etc - and can feed or trigger their rules in the same way.

They can also virtually meet other users, perhaps from rooms in another town - linked and joined together with theirs by simple URLs - maybe to keep an eye on a grandparent, and their locks and lights and health.

Friday, 10 January 2014

Monads and Cyrus

A question came up on the ThoughtWorks tech forum yesterday:

"What actually is a monad, and why should I care?"

Various people had a go, or directed the OP to their favourite exposition. Not wanting to miss this opportunity to promote my Cyrus language, I also replied:
____

This is just a practical approximation to give you a feel for how I see the whats and whys of Monads. Happy to take corrections if I've actually got it all completely wrong. And apologies to anyone who feels patronised by my jolly style or who is a Haskell programmer and whose teeth start to grate..


A Pure Functional World

Say you love functions sooo much that you want everything to be a function in your programs. So that's:

output=f(input, input, ..).

Everywhere. And for the same inputs, you always get the same outputs.

Programs are built by chaining functions:

final-output = f1( f2(3), f3(4,"banana") )


No State?!?

First thing this means is no state - you can't have persistent state. State as-in "value that something takes at some point" can only be represented by those input numbers and strings: 3, 4, "banana", and the outputs of functions.

So you can have "state", as long as it keeps being juggled transiently between the inputs and outputs of functions, maybe recursively.

But you really want state, because the Real World has absolutely bloody tons of it. Computers and programs that do real work have user interfaces and databases.

So you're just going to have to juggle and maintain those transient values between functions, and do some recursion to keep the plates spinning.

If only there were a way to make all this value juggling and plate spinning easier. A functional programming pattern of some sort.. it would have to have an academic, intimidating name, to put people off thinking that State is Great, or anything like that.


Enter The Monad...

In fact, all you need to do is to juggle bigger, smarter values!

A Monad is just an aggregate, a container, a wrapper, a raiser-upper of state which allows you to still be completely functional and yet still pass around all the state you need in your entire program.

Indeed, to make the point: you could go really nuts and have a program like this, for your database:

end-of-day-database-state = f5( f4( f3( f2( f1(start-of-day-database-state)))))

where each fN() is a transaction, or a selector that carries forward the selections plus the entire database.

A better notation, perhaps for browser GUIs, would be:

f1(starting-DOM-state).f2().f3().f4().f5()

which can pass the DOM state through, along with, again, selections - a subset or working set. Look familiar?

So, in general, you want to apply little functions to little bits inside the whole passed/juggled state. You never change the whole database or the whole GUI at once. Perhaps just a field in the database or GUI. You may have intermediate states that get added to the aggregate and passed on to the next stage.

Actually, f1() in both examples is special, because it takes a "simple" state or value and raises it up to this wrapper/aggregate/super-value - it creates a Monad. It's like $() in JQuery. Similarly f5() is special, at least in the database example, as it goes back again to the simple state. The simple state doesn't know about all this aggregate, compounding stuff: it doesn't have the functions or methods that juggle and spin plates.


Why not just have explicit, big state objects instead of Monads, and only use pure functions to transition those objects between states?

Exactly. It would be way easier than all this juggling and plate-spinning, and much easier to see what was going on. You could give those state objects URLs, and everything. :-)

Thursday, 9 January 2014

Augmented Reality and the Internet of Things

As I explained a while back, this blog is all about my exploring the relationship between Augmented Reality and the Internet of Things.

In my Manifesto for the Internet of Things, I described my vision:

To invisibly merge the real and the virtual, creating ambient and ubiquitous interaction, and to empower people over the control and sharing of their physical items, virtual data and the rules that animate them.

Of course, none of this is particularly original. Mark Weiser's vision of Ubiquitous Computing from the Eightie's amounts to much the same thing:

Ultimately, computers would "vanish into the background," weaving "themselves into the fabric of everyday life until they are indistinguishable from it."

However, do a Google search for "Augmented Reality" "Internet of Things", and there are very few who share the view that Ubiquitous computing can be realised by the combination of these two hot topics.

Here's a Wired article from 2010. And ABI Research agrees. That's pretty much it.

But it seems obvious to me that, if we are to be surrounded by a fabric of reality merging with the virtual via the Internet of Things, we ourselves will play within that fabric using what we today call "Augmented Reality", via smartphones, tablets, glasses and projectors, or holographic projections and wall-sized screens that react to our gestures.

Maybe IoT people just naturally embrace AR without a second thought. Not sure if AR evangelists are so aware of the potential of the IoT, though.

Wednesday, 8 January 2014

Navigating Things and Places Around You

Some small progress, from 20 minutes here and there on the train to and from Waterloo...

I've added a menu item to switch to navigating NetMash by Things around you.

It starts you off viewing a 3D place or "room" containing the three light objects as you've seen before, then if you move your phone towards a broadcasting Thing, it jumps to showing you that 3D object up close. If you move back, you are back in the place again.

Here's the menu, showing the "Around" option:


You can also see underneath that the "Objects Around" object, which not only lists the three broadcasting Light Things I had before, but now has their common place object, too, the "Room of Things". This link is found by grabbing the "within" links of the lights. The place is given a fixed distance of 20.

So, if you're in jumping "Around" mode, then the nearest item in the list above is jumped to, which is the place "Room of Things" - unless you move the phone near to one of the BLE dongles, or less than 20 away from it. Clunky algorithm for now, but will be refined.

I'd show you screenshots of the 3D stuff, but you've already seen them: it's the jumping that is important. When I've smoothed it out enough for a video, I shall do that instead.