Updates to LiveCode’s platform support policy

by Peter Brett on July 21, 2016 No comments

Over the last couple of years, it’s been very exciting to see people developing and deploying LiveCode apps on a amazingly wide variety of platforms and operating systems, from Pentium 3 servers running CentOS 5 to retina iMacs running the OS X El Capitan.

Today, we’re updating our policy for platform support to clarify and streamline it.  We’re doing this to:

  • help LiveCode app developers make good “system requirements” recommendations to their users
  • explain which platforms we use to test LiveCode features before making each release
  • make it feasible to provide a very high quality LiveCode Support service by clarifying which platforms are covered by the service

What's a platform?

A platform is a combination of computer hardware and a particular version of a particular operating system environment. For example, “OS X 10.10 x86” is the Yosemite version of OS X running on an Intel-compatible 32-bit processor.

LiveCode supports 5 operating systems at the moment: Windows, Android, Linux, OS X and iOS.  These all have differing vendor support, versioning systems, third-party ecosystems, and uptake by the LiveCode developer and user community.  This means there’s no “one size fits all” support policy that can simply cover them all, so we’ve tailored our new platform support policy to suit each of them. I’ll go through them in turn.

Windows is still the most widely-deployed operating system in the world, and there are more LiveCode developers and end-users using Windows than any other operating system.

LiveCode is supported on Windows when it is running on x86 (32 bit) and x86-64 (64 bit) hardware.

The oldest version of Windows that LiveCode currently supports is Windows XP, which is deployed on approximately 10% of Windows computers.  Microsoft have now dropped all support for both Windows XP and Windows Vista, which is making it increasingly difficult and costly to support LiveCode for those versions of Windows.

In LiveCode 8.2, we will end official support for versions of Windows that are not supported by Microsoft.  This will include ending support for Windows XP and Windows Vista.

Windows platform support information
LiveCode 8.1 LiveCode 8.2
Windows XP Yes No
Windows Vista Yes No
Windows 7 Yes Yes
Windows 8 Yes Yes
Windows 8.1 Yes Yes
Windows 10 Yes Yes

One of the biggest challenges when deciding how to support Linux users is the bewilderingly large variety of different Linux distributions.  Some always have the very latest versions of every program; some only update programs when they have to.  Some distributions are designed to run in a massive cluster in a datacentre, and some are designed for children’s laptops.

We decided to base our Linux support policy on specific versions of specific Linux distributions.  We looked at lots of factors when designing the policy, including the quality of support provided by the distributions, how widely used they are, and their release cycles.  We also looked at the rate of change in Linux development tools and libraries.

For the LiveCode IDE and standalones, we decided to provide official support for the Ubuntu and Fedora distributions.  This includes:

  • the latest release of Ubuntu, and versions of Ubuntu with Long Term Support that have been released in the last 4 years
  • the current and next-to-current releases of Fedora

Because Linux is so widely used for LiveCode Server deployments, we decided to provide official server-only support for Debian and CentOS, two distributions widely used on Linux servers. This includes versions of Debian stable and CentOS that receive official vendor support and were released in the last 4 years.

We will currently only provide official support for x86 (32 bit) and x86-64 (64 bit) Linux.

Linux platform support information
Desktop Server
Ubuntu 16.04 Yes Yes
Ubuntu 14.04 Yes Yes
Fedora 24 Yes Yes
Fedora 23 Yes Yes
Debian 8 (Jessie) No Yes
Debian 7 (Wheezy) No Yes
CentOS 7 No Yes

Android is the most widely-used mobile operating system in the world. Apps built with LiveCode currently run on all versions of Android from 2.3.3 (Gingerbread) onwards.  However, certain features may not be available, depending on the specific version of Android being used and the device on which it’s running.

Currently, we compile LiveCode in a way that lets it run on ARM v6 hardware or newer.

When we were considering which versions of Android should be officially supported, we looked at how widely used different versions of Android and device hardware were used.  Versions of Android older than 4.1 (Jelly Bean), and ARM v6 hardware, are now quite rare.  Dropping support for these older Android devices will allow us to make LiveCode considerably faster, by taking advantage of newer hardware features.

We will drop support for ARM v6 hardware and the oldest versions of Android in LiveCode 8.2.

Note: Official support will be extended to new versions of Android when they are released for general availability.  Preview and beta releases are not officially supported.

Android version support information
LiveCode 8.1 LiveCode 8.2
Gingerbread (2.3.3–2.3.7) Yes No
Ice Cream Sandwich (4.0) Yes No
Jelly Bean (4.1–4.3) Yes Yes
KitKat (4.4) Yes Yes
Lollipop (5.0–5.1) Yes Yes
Marshmallow (6.0) Yes Yes
Android hardware support information
LiveCode 8.1 LiveCode 8.2
ARM v6 Yes No
ARM v7 Yes Yes
ARM v8 (ARM64) Yes Yes

Apple’s MacOS X operating system is very popular with LiveCode users thanks to LiveCode’s HyperTalk ancestry.  It’s also the only operating system that can be used to build iOS apps to run on Apple’s iPhone and iPad devices.

Apple currently provides security updates and other support for MacOS X 10.9 and later, and provides upgrades to newer versions of MacOS for all customers.

In LiveCode 8.2, we will end official support for versions of MacOS that are not officially supported by Apple.

Note: Official support will be extended to new versions of MacOS when Apple releases them for general availability.  Preview and beta releases are not officially supported.

MacOS platform support information
LiveCode 8.1 LiveCode 8.2
Snow Leopard (10.6) Yes No
Lion (10.7) Yes No
Mountain Lion (10.8) Yes No
Mavericks (10.9) Yes Yes
Yosemite (10.10) Yes Yes
El Capitan (10.11) Yes Yes

The iOS operating system is used on Apple’s iPad and iPhone mobile devices.  iOS app development is extremely popular among LiveCode developers.

The Apple App Store only accepts iOS apps if they are compiled with support for one of a few, most recent versions of iOS.  Currently, LiveCode has official support only for these versions of the iOS device operating system.  In the past, however, there has also been official support for much older versions of the iOS simulator (which is included with Apple’s Xcode development environment).

We will continue to officially support all versions of iOS that are supported by the App Store. However, in LiveCode 8.2 we will end official support for older versions of iOS simulator.

Note: Official support will be extended to new versions of iOS when Apple releases them for general availability.  Preview and beta releases are not officially supported.

iOS platform support information
LiveCode 8.1 LiveCode 8.2
iOS 6.1 Simulator No
iOS 7.1 Simulator No
iOS 8.2 Yes Yes
iOS 9.2 Yes Yes
iOS 9.3 Yes Yes

As you can see, LiveCode has official support for a very large variety of platforms!

But wait; there is more! There are several platforms where LiveCode isn’t officially supported, but can be made to run quite well, such as on the Xubuntu variant of Ubuntu Linux, or on ARMv6 Linux distributions running on tiny Raspberry Pi computers.

And what if changes are needed to make LiveCode work on your favourite platform? LiveCode is open source software, and the core dev team will always accept reasonable patches to make it easier to compile and use LiveCode on a wide variety of platforms.

In the future, we will try to ensure that we always clearly indicate what platforms you can get official support for, and we will soon be updating the support area of the website to make this information easier to find.  We’ll do our best to give as much notice as possible when a particular platform is reaching end-of-life.

If you have any questions about our platform support policy, please contact our support team.

read more
Peter BrettUpdates to LiveCode’s platform support policy

Faff-free files function

by Peter Brett on July 13, 2016 No comments

The next developer preview release of LiveCode 8.1 will contain a long-requested enhancement to make writing programs that work with files much easier.

For time immemorial, the files() and folders() functions in LiveCode Script have operated only on the current folder (also known as the current working directory), which is accessed using the defaultFolder global property.

Unfortunately, setting the defaultFolder can fail for many reasons.  For example, it might fail if the requested directory doesn’t actually exist, or if you don’t have permissions to read it.  A reasonably robust implementation of a ListStackFilesInFolder() function that lists the stack files in directory might look something like this:

read more
Peter BrettFaff-free files function

How Editing Large Scripts is Faster!

by Peter Brett on September 3, 2015 1 comment

In LiveCode 8 DP 4, we added the exciting new ability to create HTML5 standalone apps that run in a web browser.  But that’s not the only new feature in the open source edition!

When editing very large scripts with lots of handlers, it can often be difficult to find the handler you want in the handler list view. Now you can use the filter field to quickly narrow down the options to the one you’re looking for.

read more
Peter BrettHow Editing Large Scripts is Faster!

How to Run Your App in a Browser with HTML5!

by Peter Brett on August 31, 2015 8 comments

The modern web browser has become a fully-featured application platform – and nearly everyone has one.  If you can write a program to run in a modern web browser, you know that it can be run anywhere with no need to install it.

As of now, you can deploy your LiveCode apps to the web. Welcome to HTML5.

read more
Peter BrettHow to Run Your App in a Browser with HTML5!

Testing And Building LiveCode Builder With Tests

by Peter Brett on April 9, 2015 3 comments

We recently launched the first developer preview (DP) release of LiveCode 8, which provides a first look at LiveCode’s new “LiveCode Builder” language. This is a powerful new compiled language which can be used to quickly and efficiently develop new controls and code libraries for use in LiveCode apps.

I’d like to tell you about some of the techniques we’ve been using to make sure that LiveCode Builder is robust and reliable.

read more
Peter BrettTesting And Building LiveCode Builder With Tests

Racing to a Temporary Fix

by Peter Brett on November 13, 2014 8 comments

Recently, I’ve been spending most of my time working on a Secret Project* for LiveCode 8.0.  But the remainder has been spent on my other areas of interest: Linux, server-side LiveCode, and security. Today, we’re going to touch on all of those topics.

Temporary files

You will often find yourself using temporary files. For example, sometimes your app will need to run some other program, and will need to provide it with an input file.  Or perhaps you receive data over the network, and need somewhere to stash it while waiting to decide whether to put the data into long-term storage.

LiveCode provides some tools for working with temporary files. In particular, there is the tempName function, which generates a uniquely-generated filename.

For example, if you write

put the tempName

in the message box on Linux, you might see something like:

/tmp/filevZr4DG

So, the simplest way to create a temporary file for your LiveCode server app to use might be something like:

-- Don’t do this
put the tempName into tTempFile -- 1. Generate a filename 
open file tTempFile for write -- 2. Open the file

Why do I say not to do this?  It’s because of a very “classic” programming problem called a “race condition”.  Read on for an explanation of what this is, how it can affect your app, and how to avoid it.

Race conditions

Modern operating systems can run more than one program at a time.  There are two ways in which they can do it:

  1. if there are multiple CPUs available, then each of them can simultaneously run a program
  2. the operating system can switch the program that each CPU runs at any time (this is called “pre-empting” a program)

Now suppose two programs are running, and suppose that there’s some resource that only one program can access at a time. If the two programs try and access the resource at the same time, then the one that happens to be very slightly faster will “win” the “race” and get to use the resource, while the slower program has to wait its turn.

File creation is a common cause of race conditions. Recall that if you open a file for writing. e.g. with

open file tFileName for write

but the file called tFilename doesn’t exist yet, the operating system will create it for you. But if another program creates a file called tFilename just before you try to open it, you’ll open that file instead of getting a newly-created file.

Let’s go back to the temporary file example, this time with some more comments.

-- *Please* don’t do this
put the tempName into tTempFile -- 1. Generate a filename

At this point, you know that tTempFile doesn’t exist. But don’t forget that other programs might be running on another CPU, or that your app might get pre-empted after step 1, and get stopped for a while.  This could mean that by the time that the next step happens:

open file tTempFile for write -- 2. Open the file

tTempFile might now exist, having been created by another program.

On Linux, and in certain circumstances on other platforms, any program running as any user can create files in the /tmp/ directory.  There are many examples of Bad Things that can happen if someone can control the files that your app writes to, including loss of data or even damage to your operating system.

You can find more in-depth discussion of this problem and some examples of the aforementioned Bad Things in the Mac Developer Library, and much much much more in David Wheeler’s Secure Programs HOWTO.

What can we do about it?

Fortunately, there’s something that can be done to work around the problem: you can use a temporary folder instead of a temporary file. However, the procedure is slightly more involved.  Let’s go through it step-by-step.

-- 1. Make sure that other users can’t read/write into the
--    directories you create
set the convertOctals to true
put the umask into tSaveUmask
set the umask to “0077”

There’s a special property called the umask which can be used control the security settings on the files and folders that your app creates.  Setting it to “0077” will ensure that only the user that your app’s running as can access any of the files or folders that your app creates (apart from system administrators).  Note that you need to enable the convertOctals first (or the security settings won’t be applied properly).  In this example we save the previous value of the umask so that we can restore it at the end.

-- 2. Keep trying to create temporary directories until we get
--    one that doesn’t exist
local tTempDir
repeat forever
 try
   put the tempName into tTempDir
   create folder tTempDir
   exit repeat
 catch e
   if there is a folder tTempDir then next repeat
   if there is a file tTempDir then next repeat
   throw e
 end try
end repeat

Unlike the open file command, the create folder command always causes an error if the requested folder already exists.  This way we can remove the race condition!  If another program simultaneously attempts to create the same tTempDir or a file with the same name, then we can easily detect it in the catch and try a new folder name. Of course, if some other error occurs, such as running out of disk space, then it is important to make sure not to block it.

-- 3. Now we can create temporary files in that directory
put tTempDir & “/tempFileNameHere” into tTempFile
open file tTempFile
-- ... and now use the temporary file! ... --

With the temporary directory having been successfully and securely created, you can go ahead and create as many files in it as you like, without any need to generate filenames or worry about race conditions (because no other non-administrator users can read or write the tTempDir).

-- 4. Reset the umask
set the umask to tSaveUmask

Hopefully this step is quite self-explanatory, unlike anything else I’ve written today.

Conclusion

Even something as simple as creating a temporary file can pose unexpected hazards, but LiveCode provides the tools to steer safely around them. For server-side LiveCode apps running on Linux, I recommend using temporary directories rather than temporary files to improve robustness and security.  For other apps on other platforms, the simple approach may be enough most of the time, but using a temporary directory won’t hurt!

*The project is so secret that I have cunningly hidden all of the code in my Github repository.
read more
Peter BrettRacing to a Temporary Fix