📜 ⬆️ ⬇️

Gestalt project - write in Ruby, Python and XAML directly in HTML on the client side

image Gestalt is an open source framework that allows you to include Ruby or Pyhton codes and even XAML markup in an ordinary html-page code. And all this will work on the client side! If you want to write client code like the following,
< script language = "python"> or < script language = "ruby">
then Gestalt is made especially for you. A quick start and the simplest demonstration can be viewed at http://www.visitmix.com/labs/gestalt/getstarted/ .

* attention, the runtime environment does not start instantly, at the very first boot you should wait a couple of seconds and everything will work


What is Gestalt?


The Gestalt project is a new brainchild of the creative team MIX Online . Previously, they already distinguished themselves by the release of the library of microformats Oomph , the engine for blogs Oxite and the unusual project Glimmer , which allows you to create animations based on jQuery .
Let us analyze this project on the basis of official examples.
')

First example


The very first example that the project offers is a demonstration of all the capabilities of the framework at once. Here is an example of using Ruby code in html:
image
The following window already demonstrates an example using Python in html:
image
As you can see, in the html code, regular Ruby and Python code is created that works with the DOM tree, including responding to events. Isn't it great?
The last page shows the joint work of the code in Python and XAML-animation written in the same ordinary html:
image
Are the examples too simple? Let's look further.

XAML graphics


The following examples show the construction of complex vector images directly from html using XAML code, which you can create, for example, in the designer of Visual Studio or Expression Blend . All of them are written in XAML and are built from markup right on the client!
image image image image image

* www.visitmix.com/labs/gestalt/samples/big.xaml/big.xaml.bedlam.html
* www.visitmix.com/labs/gestalt/samples/big.xaml/big.xaml.cheshire.html
* www.visitmix.com/labs/gestalt/samples/big.xaml/big.xaml.crystal.html
* www.visitmix.com/labs/gestalt/samples/big.xaml/big.xaml.ruffmouse.html
* www.visitmix.com/labs/gestalt/samples/big.xaml/big.xaml.yellowstone.html

Python and animation


The following examples show how Python can work with graphics, animation, and control by the user. For example, in the examples with a red globe, it is shown how to use frame-based animation and respond to user events. In the first example, the user can rotate the earth, in the second it rotates itself, and the user controls the location.
image image

* www.visitmix.com/labs/gestalt/samples/image.sequencer/image.sequencer.simple.python.html
* www.visitmix.com/labs/gestalt/samples/image.sequencer/image.sequencer.advanced.python.html

Python and trigonometry


The following examples show the use of Python for calculating in geometric problems. For example, the first example calculates the movement of an element along a circle, and in the second most elegant example, a three-dimensional model of related entities is calculated, it looks very impressive and is completely controlled by the mouse:
image image

* www.visitmix.com/labs/gestalt/samples/trigonometry/trigonometry.simple.python.html
* www.visitmix.com/labs/gestalt/samples/trigonometry/trigonometry.advanced.python.html

Python and Transformations


Regular examples are very effective, I highly recommend to look at them. In the first example, depending on the location of the mouse, the orientation in the space of three-dimensional objects changes, they sort of follow the mouse. On the second, the same thing happens, only the pieces of the original image are transformed. It looks very cool, especially if you consider that all this is simple Python and XAML code right in the html body.
image image

* www.visitmix.com/labs/gestalt/samples/transforms/transform.simple.python.html
* www.visitmix.com/labs/gestalt/samples/transforms/transform.advanced.python.html

Python, Ruby and Particles


The following examples show how the framework works with particle animation. So the first, the simplest is a falling snow, the second is the scattering lines drawn by the mouse, and the third most complex shows several techniques at once: drawing, particles, animation, movement, disappearance of particles. It looks spectacular:
image image image

Unfortunately, in statics all this does not show, you need to look in the dynamics. All examples are written in Python, but by downloading the source code you will find the first example in Ruby.

* www.visitmix.com/labs/gestalt/samples/particles/particles.simple.python.html
* www.visitmix.com/labs/gestalt/samples/particles/particles.medium.python.html
* www.visitmix.com/labs/gestalt/samples/particles/particles.advanced.python.html

Python and canvas


For the following example, you will need something different from Internet Explorer, since it will be about working with canvas using Python. A simple example shows how to draw simple shapes.
image

* www.visitmix.com/labs/gestalt/samples/canvas.2d.drawing/canvas.2d.drawing.html

Python and Twitter


And finally, the last demonstration, and this is probably the best of them, because it offers to look at the implementation of working with Twitter in a simple html-code using Python for logic and XAML for a pleasant visualization.
image

* www.visitmix.com/labs/gestalt/samples/twitter.badge/twitter.badge.python.html

How it all works


Of course, miracles do not happen and all this should work with the help of something. This “something” in this case is Silverlight - a wonderful technology that is not tied to any language that allows you to write applications in C #, even in Python, or in Ruby. When Gestalt begins its work, it initializes the Silverlight element and uses it to execute Ruby and Pyhton code or draw XAML markup.
Gestalt is a cross-platform technology, work is guaranteed on Windows and Mac. For Mac users, the Gestalt development team prepared an extra bonus :

In addition, the following utilities and tools are available :

What about Linux?


Miguel De Icaza , Mono and Moonlight development manager, has already responded to the Gestalt project. In his blog, he wrote literally the following:
All four pieces (Gestalt, the Dynamic Language Runtime, IronRuby and IronPython) are available.

Thus, Miguel confirms that Gestalt is also available for linux users. Try it.

useful links




Conclusion


According to riastats.com, Silverlight is already installed on a third of computers on the Internet. This is a huge number of customers and the proportion is growing every day. I am very pleased that this technology allows you to do such unique things, create your own Ruby and Python code directly in the markup. In my opinion, this is a great example of how technology mixes and makes friends today, as developers who are free from superfluous ideologies can use a whole set of techniques for their own benefit to make amazing things in a completely new way. And, of course, you always have a choice: do not like XAML, use canvas, as shown in the example above.
So, with the help of the Gestalt project , Silverlight and Google Wave were already friends ! Great start to cool technology!

Progg it

Source: https://habr.com/ru/post/65470/


All Articles