Can floating point representation be improved?

24.07.2015 Leave a comment

If you ever wrote any code which used floating point numbers, you are probably aware, that the widespread floating point format, also known as IEEE-754, is full of caveats.

Due to the representation used, floating point computations are usually unstable. The errors of certain operations grow rapidly, operations are order-dependent and you can obtain different results on different architectures.

Here is an incredibly promising proposal of unum, a number format which improves the current floating point format in all areas: John Gustafson Explains Energy Efficient Unum Computing.

There are many areas, where this could provide improvements, not only in the quality of programs, but also in energy efficiency.

In particular, scripting languages would benefit from it a lot. For example, JavaScript has a single Number type. This creates a lot of problems, because it is hard to make computations reliable, and there is a limited precision for integers. Using floating point representation for integers was a very bad design choice for JavaScript. With unum, this could change and a single numeric format would make sense.

Another example are statically typed languages, where an elaborate type system leads to headaches. With unum, this would no longer be a problem, and the type system could be simplified, especially because unums can be represented with a variable number of bits (although do not have to). Integer calculations can be carried as fast with unum as they can be carried out in regular 2’s complement representation. And at the same time, unums support floating point numbers.

Will unum prove to be useful and become widespread? I certainly hope so.

Categories: Computing

Who are you?

10.05.2015 Leave a comment

Do you consider yourself a magical being driven by an invisible soul, or a biomechanical wonder, an incredible system consisting of nanomachinery and water, an organic robot?

If you can provide an unbiased, honest answer, I suspect your answer will be correlated with your belief system.

Categories: Universe

C++ wrapper for WinAPI

16.04.2015 Leave a comment

By popular request, I just uploaded the full WinAPI Wrapper library source code on GitHub.

[WinAPI Wrapper on GitHub]

This library is a very thin C++ wrapper for the Win32 API, which is a C API. The overhead of the wrapper is almost none.

The last modifications to this source originate from 2003. The development seized around that timeframe. I haven’t done any development on/for Windows for many years now, I rarely fire up Windows these days. The library can still be used for writing a wide range of apps, although I imagine that the Win32 API has evolved since and the library could benefit from some adjustments.

Whether I will maintain it further remains to be seen. 🙂

Categories: Computing

The future of driving

14.04.2015 Leave a comment

As the era of robots is approaching, self-driving cars are a hot topic.

The transition to self-driving cars will be gradual. Initially, cars will be able to drive autonomously only in perfect road conditions, e.g. on the well-marked freeway. Perhaps initially we will have single lanes for self-driving cars, where it will be forbidden for humans to operate the steering wheel, except for critical situations. Eventually robot-only lanes will be expanded to entire sections of roads and freeways. Autonomous vehicles will be much safer and faster on the freeway than human-operated vehicles.

Less developed countries will soon become an excellent testbed for self-driving cars. In many countries, the quality of roads is very low, some roads don’t have lane markings and are full of obstacles. Also, the road laws don’t seem to apply in many countries and are treated by drivers only as guidelines. Driving in these countries is going to be a great challenge for self-driving cars.

Now, here is an idea for a self-driving car feature.

Imagine driving on a winding road with a high speed limit behind a tractor or another slow vehicle. You cannot overtake it, because you cannot see far enough ahead. A self-driving car could be equipped with a drone. When visibility is limited, the car could deploy the drone to check out the conditions ahead. The drone would be continuously sending images and its position back to the car, so the car would know, whether it’s safe to overtake even if there is no visibility. The self-driving car would know, that there are no other cars on the lane in the opposite direction.

The drone could also be equipped with a radar, which would make it useful in foggy conditions. Upon encountering fog, the car would deploy the drone and could keep driving at a high speed, because it would have the image of the road ahead.

The drone’s battery would have a limited capacity, so the drone could only be deployed for a limited time, and would need to return to the car for charging. A more expensive self-driving car could be equipped with two drones. While one drone is in operation, the other drone could be charging.

Ideally, the drones should be cheap and should use a standardized communication protocol as well as support a standardized docking mechanism. It would be common to lose a drone, so it should be cheap to buy a new one, or upgrade it.

The drones would probably be useful to self-driving cars even if all cars were self-driving and communicating with each other, esp. in cases where road visibility is limited and pedestrians or animals are present near the road.

Categories: Universe

How to end all wars

4.04.2015 Leave a comment

Wars don’t do much good to our civilisation. Aside from all the pain and sorrow they cause, they also set us back due to all the damage they inflict. How to prevent them? Here is an idea.

There is a theory that our civilisation began to coalesce when the levels of testosterone in men fell low enough, that men became willing to cooperate. Before, when the levels of testosterone were high, men were too aggressive to cooperate.

My theory is that the primary reason for all the wars, which are currently happening, are still high testosterone levels. Just as most crimes are committed by men between certain ages.

To end all wars (and also prevent crimes), we need to lower the levels of testosterone in men. One way to do that would be to have all men between certain ages take pills which reduce testosterone. Another way would be to alter our genome, so that men produce less testosterone in the first place. Low testosterone levels should at least be mandatory for all men, who have decisive powers, including governments, government agencies, military, police, as well as all men, who have ever committed any crimes.

It sounds drastic, but I’m sure it would make the world a better place. Testosterone is the main source of evil.

Putting your ego aside, can you think of any drawbacks?

Categories: Universe

Transcendence (2014)

25.03.2015 Leave a comment

If you like good Sci-Fi and haven’t seen this movie, I recommend watching it.

Transcendence is unlike most recent and popular Sci-Fi movies, where the story usually goes like this: AI takes over the world and its first goal is to exterminate or enslave humans. I’m personally getting a little tired of the meme that AI will make us miserable…

Spoiler warning

Transcendence depicts human fears of new technologies. In this movie, the scientist, who uploaded his own mind to a computer, becomes the good guy and humans who don’t understand him are the villains. Given the currently increasing fear of AI, I’d say that’s a quite believable story…

Categories: Movie Reviews

Interview question: Which browser do you use?

17.03.2015 Leave a comment

Big Data says, that employees who use a non-default browser, such as Firefox or Chrome, stay with the job 15% longer than those using a default browser, such as IE or Safari.

Well, if Big Data says it, it must be true!

(There – I finally said it. 😉

Categories: Other