LiveCode Server

by David Williams on March 6, 2014 5 comments

Here at On-Rev, we make extensive use of LiveCode Server internally for scripting – you’ll see a lot more filenames ending in .lc than you might in .sh, purely for the reason that LiveCode Server is great for making scripts that are a lot more readable than, say, a bash script, and we can drop in shell commands with ease where necessary.

One recent feature that was introduced in LiveCode 6.6 was the ability to use hashbangs (#! /path/to/livecode) in LiveCode server scripts instead of script open and close tags (<?lc ?>). This means that we can have scripts which look like this:

#!/path/to/livecode-server
put “hello world at” && the millisecs

Instead of this:

<?lc
put “hello world at” && the millisecs
?>

The difference is that the latter has to be passed as a file to the LC Server exectuable, which then parses the code for output. This makes sense where LC Server is integrated into a web server software for serving webpages, but if we were doing this in a command line, it would look like this:

root@mybox [~]# /path/to/livecode-server ./script.lc

Whereas by using hashbangs, we can now execute the script directly, as the script contains the information for how it should be executed:

root@mybox [~]# ./script.lc

This seems like a minor change, but it brings the LC Server engine closer to how scripting for system utilities should function in a Unix environment, and allows me to tidy up some of the internal systems we use a little bit.

Additionally, work on the On-Rev client has been ongoing and we hope to release an update as soon as some of the last technical hurdles are overcome – we hope to send out a notification about this to all our On-Rev customers in the near future.

David WilliamsLiveCode Server

Related Posts

Take a look at these posts

5 comments

Join the conversation
  • Michael - March 6, 2014 reply

    Thanks for the information David, I might actually try and put the server engine to use on my Arch VM as Bash is still quite scary to me. 😀

  • Christer - March 6, 2014 reply

    Certainly running scripts with Linux commands is useful in terms of product development.

    However, the server is always used in conjunction with the device operation, which means you create functions in the server, feed in data from the device and get the result back to the device. Obviously in the longer term the server will take more and more of the tasks out from the device and drive just the U/I with HTML5; which still is equal to that you send data to the server and get back something.

    So my wish to the LiveCode team is to focus to develop an IDE for joint device and server code development. Today’s method is you need to build your own server emulator in today’s IDE environment, debug it and move it to server. The con’s are you need to build and manage this emulator, the pro’s are you can implement seamless transition of device tasks to the server – at all times staying in LiveCode coding with no externals.

    And as an interim solution a fluent IDE for code development directly in the server.

    Look forward to seeing the development.

  • Mark - March 6, 2014 reply

    Nice to see this old MetaCard feature to be restored.

  • Ed Gore - March 7, 2014 reply

    Appreciate any and all improvements to the Server engine! Looking forward to having a new version of the on-rev client as well!

  • David Bovill - May 4, 2014 reply

    Good post David!

    You might want to add a comment about permissions here. Dragging and dropping the server distro onto your Home folder (on OSX at least) – and trying the script above results is: “bad interpreter: Permission denied”

Join the conversation

*