Lucee in the Sky with Diamonds - Mura Digital Experience Platform
In Flow: The Mura Blog

Lucee in the Sky with Diamonds

December 12, 2018 by Grant Shepert

Why Lucee, a light-weight, dynamic scripting language for the JVM is a key player in the Mura stack. The McCartney to our Lennon, if you will.

But first, what is Lucee, and why would you use it? These are questions that we get asked occasionally, as foundationally Mura is built upon this particular programming language.

The answer we give is often less than we would like, because there is always too much to say.

The reasons are both simple and complex, a part of our history to be sure, but more so because we feel it is absolutely the right tool for the job.

What is Lucee?

Lucee is a tag- and script-based programming language that runs on the Java Virtual Machine (JVM). As an open-source implementation of CFML, it is a fantastic programming language, easy to use and learn, powerful and highly capable, with a host of important features that make it an ideal environment for development.

Lucee has been around for a very long time, and in this time it has grown expansively. Although not a pre-compiled language, Lucee compiles the code directly into Java bytecode, and its tight integration to Java means that it can use and manipulate Java libraries natively.

Also, while it is a script-based language (think ECMA-based script languages like JavaScript), the programming style is very much object-oriented via Components (CFCs) and the numerous programmatic frameworks that exist. It also has an integrated Hibernate-style ORM framework, as well as a rich set of file, server, and messaging functionalities.

Why Lucee?

That's a bit of an existential question, to be sure. The why of Lucee really comes down to the language's powerful set of tools and options, its ability to rapidly prototype concepts into functional objects, and its overall scalability and reliability as a platform.

The biggest why, of course, is that we love it. We love its flexibility, its maturity, and its power.

Few other languages are as versatile or tested, nor have we encountered any other language that is so readily mastered by developers.

Separation of Purpose

One of the best aspects of Lucee is its flexibility as a coding language. As mentioned before,  Lucee has a script-based syntax which is ideal for developers moving from an environment like JavaScript, which is most often used for writing core business logic like code libraries and server-side APIs. It also has a script-based language (such as PHP, for instance), which allows for easy integration of codified markup on the presentation layer.

While it is easy for coders to develop bad habits like coding within the presentation layer, there is certainly no reason why this needs to be the case, especially once you start leveraging Lucee's powerful remote functionality like web services, proxies and API endpoints. With the increasing popularity of JavaScript-based frameworks like Vue and React, it isn't uncommon to see Lucee acting as the remote API for expansive view-tier or mobile applications. These also take advantage of Lucee's robust security implementations, advanced caching mechanisms and cloud-friendly session architecture.

Ease of Learning

This has always been Lucee's strength and weakness. The latter is a more historical case. Because Lucee is so easy to learn (this isn't is crazy easy to get up and running), there was a tendency for new developers to not step past the rudimentary paste-code-anywhere-and-it-works level of skill. With the advent of better frameworks, dissemination of information and learning platforms like Udemy, it is far more likely now that developers will step into their role with a firm level of understanding (and quickly!).

The reason Lucee is so easy to learn is it starts in an area that developers likely already have a firm understanding.

If they are using the tag-based syntax, they understand the concepts of HTML and can pair this with the function-oriented tags. If they are starting with the script-based syntax (highly recommended) then they will instantly see similarities with JavaScript. Either way, extending these base associations with tools like queries, PDF generation and file interaction becomes quickly familiar.

Mura & Lucee

Lucee has added a great deal of flexibility to the Mura Ecosystem. Because of its inherent flexibility, we have been able to build a robust set of development-friendly tools into Mura itself.

MuraORM, which mates automated Object-Relational Mapping with Mura's core object model, the JSON API which exposes (in a secure, permissions-oriented environment) the entirety of the core to remote development such as Vue or React, and Mura.js, which integrates jQuery-like DOM interactions with a much more feature-rich Mura-oriented library.

Beyond Lucee

While Mura's foundational language is Lucee, there is also a much wider range of language accessibility available to developers. A great deal of the work we do on both the front-end and within the administrator is now done using JavaScript frameworks like Vue and React, along with Mura.js and the JSON API. Both of these also allow for remote integrations with any existing applications an organization might already be using, and there is a specific Node.js package, as well.

Onwards & Upwards

With the advent of containerization and important tools like Docker, the idea of Mura as an infrastructure, rather than an application, becomes more apparent. We like the language a lot (obviously) and it continues to grow within an active community, supported by industry professionals.

Beyond that, Mura will always be ready to adapt to the next greatest thing, because it is designed from the ground up, starting with Lucee and continuing through our own toolset, to do just that. It's an important part of what allows us to find Flow, and as a result, help create meaning in our work as developers. We're sure it can do the same for you.


About the Author

Grant Shepert has been a developer for nearly 20 years, and started using Mura the year it was released. Since then he has written dozens of plugins, spoken about Mura in conferences around the world, contributed code to the core project in numerous ways (his favorite being the FormBuilder), acted as Mura instructor, mentor and evangelist and, when time has permitted, written a blog post or two.