zondag 25 december 2022

Shed Skin restricted-Python-to-C++ compiler 0.9.6

I recently decided to sit down and finally port Shed Skin, an experimental restricted-Python-to-C++ compiler in the works since 2005 or so, to Python3. Three painful months and a total diff of 50k lines later, everything now works with Python3 (Shed Skin itself, and all tests and examples..)

This does not mean that every Python3 feature is supported, but what was there now at least works fine with Python3.. For example, unicode is still restricted to 1-byte characters, and there is no support (yet) for nice new features such as f-strings. Python2 support has been dropped with the new release, and subsequent releases should add support for various new Python3 features.

The following people have contributed along the way:

  • Johan Kristensen (large patch for moving from compiler.ast to ast, still on Python2)
  • Shakeeb Alireza (extension module support for Python3, ported many examples, improved OSX support, and various code cleanups)
  • Folkert van Heusden (some fixes on the C++ side, move to c++17)
  • Jeremie Roquet, Thomas Spura, Paul Boddie and others who kept doing maintenance on the project in my absence

I started work on the port after realizing that Shed Skin was being removed from distributions, especially Debian, as it was still tied to Python2, and I really want to keep Shed Skin in a working state if possible.

So what about the future of the project? Not really sure, but I'm happy to sit down again in a few months to prepare a new release. Any feedback on what to support or improve would be very welcome!

For fun, here are screenshots of some of the Shed Skin example programs (in total 75 working example programs can be found on the github site):

dinsdag 22 maart 2022

TACO VR: an Infento-based omnidirectional treadmill (unfinished prototype)

The initial excitement of owning a wireless headset such as the Oculus Quest is quickly followed by disappointment in the size of one's living room. Unfurtunately there does not seem to be a solution to the problem of not being able to move around by more than a few meters without using the controllers in an awkward manner, or a satisfactory solution to me at least. For example, I really feel like one should also be able to walk up and down hills, or climb stairs and that such a thing should be possible.

There are various categories of existing solutions, each with significant downsides. There are the infinideck-type omnidirectional treadmills, which seem really expensive and bulky by design, and probably very noisy as well. Not that great for most living rooms. And as I mentioned, they cannot offer up/down movement without a completely separate system. Then there are the 'gliding bowl' solutions such as the kat-vr. This works, and to be honest I haven't tried one, but this just cannot feel very realistic. I do appreciate the elegant, cheap solution, and I mean that as a compliment. But again, there is no possibility for up/down movement. Finally, there are the prototypical "magical" shoes, that can perhaps move up and down in theory, but having to wear (bulky) shoes doesn't do it for me either. I want to be able to "feel" the ground with my own shoes, or even with my bare feet.

With this blog post, I would like to introduce my own type of solution. I'm sure others have thought of similar things, and it's not entirely finished either, so I can't yet say if it will work like I think it will or if it will turn out to be a dead end. I have mostly just been having fun working out the mechanical concept using Infento, which is a highly-recommended product for protopying sturdy mechanical devices (initially developed for making/rebuilding children's bikes). I also had to 3d print some gears, as Infento doesn't sell these (perhaps out of safety concerns - you really don't want to have kids fingers in there..).

I was worried that some Infento parts would not be strong enough to hold my weight, but so far they have held up great.

The core idea is to have a central 'rail system' that rotates with the line between your feet. Each foot has its own moving platform on this rail, that (after adding sensors and motors) follow the respective foot, and ultimately catch the foot as it comes down. After catching a foot, and based on the motion and direction of the other foot, the platform moves back to a natural position to continue walking or may stay in the same place (for example while the user is turning). But all of this is a bit hard to explain, so I tried to film the general idea (note of course that for a final solution it should be possible to lift your feet and walk/turn naturally!).

Video showing movement

The gears connect to the stationary base plate and make sure that the platforms are always facing the same direction, much as the tiles of your floor. The same effect could be achieved by adding more motors, but I thought this was interesting anyway, and probably cheaper and more silent in the end as well.

So while there is no support for up/down movement at the moment, it is clearly possible to make the platforms go up and down, or potentially even tilt (slightly).

If this were to become a real product, for safety there would probably need to be a large circular encasing (could be much more flat!), plus something to catch you if you lose your balance, much like the other solutions. The platforms would stick out of a slit in the middle, again potentially moving up/down. It would not be cheap, but could perhaps be relatively cheap when built as an open source kit. But to be honest, I'm not sure I will ever continue work on this prototype, so I'm just putting it out there.

Additional photos

update: I've started to collect specifications, parts lists etc. on github.