Thursday, March 6, 2014

What is LiveCode?

Pre-Conditions

This tutorial is written explicitly for LiveCode 6.6.2 Stable and might not work with other versions. The tutorial will not be updated!

Wikipedia Definition

The LiveCode programming language (formerly the "Revolution" programming language) is both an open-source and proprietary cross-platform rapid application development language inspired by HyperCard's programming language.

The language was introduced in 2001. The "Revolution" development system was based on the MetaCard engine technology which Runtime Revolution later acquired from MetaCard Corporation in 2003. The platform won the Macworld Annual Editor's Choice Award for "Best Development Software" in 2004. "Revolution" was renamed "LiveCode" in the fall of 2010. "LiveCode" is developed and sold by Runtime Revolution Ltd., based in Edinburgh, Scotland. In April 2013 a free/open source version 'LiveCode Community Edition 6.0' was published after a successful kickstarter campaign to make it available on floss.

LiveCode runs on iOS, Android, Mac OS X, Windows 95 through Windows 7, and several variations of Unix, including Linux, Solaris, and BSD. It can be used for mobile, desktop and server/CGI applications. The iOS (iPhone and iPad) version was released in December 2010. The first version to deploy to the Web was released in 2009. It is the most widely used HyperCard/HyperTalk clone,[citation needed] and the only one that runs on all major operating systems. LiveCode is currently in v. 6.1, which includes many enhancements for deployment in every OS platform, including iOS and Android. LiveCode released an open source version in April 2013.

Source: http://en.wikipedia.org/wiki/LiveCode

Features

Here some of the features I've discovered:

  • Runs on MacOS X, Windows, Linux, iOS, Android
  • For Web you can use LiveCode Community Server (similar to PHP, see here how to use it)
  • The web version can be integrated as CGI in Apache and is similar to PHP to use
  • Uses a language similar to HyperTalk which is very near to written sentences, thus easy to understand
  • Extremly rapid prototyping and development is possible. It's amazing.
  • The learning curve is nearly zero. You'll get up to speed in no time.
  • It is OpenSource. If you want to sell an application closed source you'll have to buy a license.
  • Extremly helpful volunteers in the support forum.
  • Under very active development.
  • A lot of effort is spent in documentation.

Place for improvement

Here some place for improvements I've discovered:

  • IDE looks a little Motif like 80's style. So it's not an eye catcher with which you see by intuition what's inside. But as with many cars the Engine is important. And LiveCode does a good job there.
  • Currently FTPS is not supported. Plain FTP transfers are a BIG security risk. (Workaround possible by using HTTPS uploads)
  • Videos are not working well on Linux. I didn't get mp4 Videos running. This is actually on the roadmap and should be solved by implementing a new media library.
  • There is currently no socket support for mobile which means you can't write any servers (FTP, HTTP or other) that run on Android and iOS (Possible Showstopper)
  • Currently a feature for Barcode Scanning is still missing
  • The web version is less documented. You need time to find all the tools
  • JSON is available through free unsupported third party libraries but generally works well. Webservices over XML however is fully supported.
  • Sometimes it's hard to find examples for your use-case as the community is smaller
  • Android still lacks some features, but is usable and under active development
  • Commands can differ depending on the OS. So sometimes you'll have to check on which OS you are and execute different code. But they keep it to the minimum and there are methods with which you can determine very easy on what OS you are.
  • Two Videos in layers over each other won't play. There are redraw issues.
  • The stack files are binaries so versioning with Subversion, Git will not display the changes so you loose the ability to view changes between versions, but you can still use these tools for versioning. There is a tool called lcVCS that exports and imports stack files to a structured folder of json, script and image files.
  • No namespace handling. You'll have to define your namespace on handlers (functions, methods). Example: eePlayerStart, eePlayerStop, dbOpen, dbClose. You can however use OOP. Read the following article to see how it can be done.
  • Code documentation such as you are used to with tools like JavaDoc are not yet part of the core product. There are however some third party libraries.

Main language highlights

Rapid Prototyping

When developing an application for a customer the best way in my eyes to gather the requirements is to sit down with him and sketch out the interfaces. As LiveCode is pure WYSIWYG you can start sketching in the application itself by placing form elements on to the cards (pages). The customer is seeing instantly how the application will look like and can give his input. This is a tremendous time saver because as soon the layout has been created you only need to code the interaction between the elements.

Cross Platform Development

This is the first coding tool I see that has all the functionality for real cross platform development including the most important mobile OS's.

Mobile / Desktop

Imagine you have to write an application that supports Android AND IOS? Or you also have to support Windows and MacOS? What a tremendous effort. Not only do you have to be proficient developing in C and Java, but you also have to understand the philosophy of all frameworks. You'll have to repeat writing the same code in different languages on different frameworks. You'll also go through updating all frameworks individually during the Lifecycle process. With LiveCode you just have to adopt to the simple Philosophy of Stacks, Cards and Message Paths and only maintain one code base.

Game Development

LiveCode is purely ready for 2D games. All widgets (tools) can be skinned with images and you can use collision detection through transparency.

Support

I've started using LiveCode without a license and asked questions on the forum. The community is great and growing. Most of my questions were answered by the volunteers in the forum. For small projects this is sufficient. I wanted however to build closed source applications. If you want to build closed source applications you'll need at least an Indy license. So I bought one. This enabled me to write to the support team and build closed source applications. When working with LiveCode you'll come however to the point which may require that bugs are fixed quicker or you need expert knowledge from LiveCode to solve certain issues. I've decided to upgrade to a business license out of this reason. I had a call with a dedicated Account Manager and I can ask questions based on their "fair-use" principal. As long you spend enough time investigating your issues before contacting them and the issue you have is really justified they will answer instantly and do their best to solve your issues. Up to now I'm very satisfied with the support provided. I've never experienced this with any other development language.

Alternative to Java?

From a licensing point of view it could be considered as alternative to Java. It also runs on several operating systems and it even supports mobile devices. People that love the Java coding style however may not be satisfied with LiveCode at first and will miss many libraries that they'll have to write themselves. On the other hand LiveCode is OpenSource and for some companies it may be an advantage to develop their own plugins and externals together with the benefit of lower Licensing costs. Or the benefit to sell certain libraries back to the community.

Since Java is belonging to Oracle, they started to sue other companies for using parts of Java commercially. See for example claims against Google.

  • Since LiveCode has gone Open Source you can be sure that the Engine itself is purely LiveCode and does not contain any other third party libraries that conflicts with a license from any other company.
  • Through the Licensing Model you can be sure that you won't receive claims from LiveCode when you payed for the License.
  • Additionally try to get support from Oracle if you're not a monster company with infinite financial background.

Source

The source can be found on GitHub: https://github.com/runrev/livecode