CFML - sgml/signature GitHub Wiki
| Step | What They Did | Why It Worked | Cyclomatic Complexity (Relative) |
|---|---|---|---|
| Language spec study | Used publicly documented CFML tags (<CFQUERY>, <CFOUTPUT>, <CFIF>) as blueprint |
Syntax was open to developers, even though the runtime was closed | Low (straightforward parsing rules) |
| Behavioral testing | Ran CFML apps on ColdFusion, observed outputs, replicated them in BlueDragon | Allowed them to match ColdFusion’s semantics without source access | Medium (branching test cases) |
| Clean‑room parser | Wrote their own CFML parser/compiler in Java and later .NET | Ensured legal independence from Allaire/Adobe’s proprietary C++ code | High (complex branching in parsing/AST) |
| Database layer | Implemented DB connectivity via JDBC (Java) and ADO.NET (.NET) | Paralleled ColdFusion’s ODBC model but with different internals | Medium‑High (query execution paths) |
| Compatibility matrix | Built regression tests comparing ColdFusion vs. BlueDragon outputs | Guaranteed tag‑level compatibility for developers migrating apps | Medium (test harness branching) |
| Platform expansion | Targeted J2EE servers and .NET frameworks | Extended CFML beyond ColdFusion’s native runtime | High (multiple runtime branches) |
| Custom tag support | Re‑implemented <CFINCLUDE> and custom tag execution pipelines |
Preserved developer workflows without needing original internals | Medium‑High (nested execution flows) |
#!/usr/bin/env python3
import re
class CFMXCompiler:
OPERATORS = {
" EQ ": " == ",
" NEQ ": " != ",
" GT ": " > ",
" GTE ": " >= ",
" LT ": " < ",
" LTE ": " <= ",
" AND ": " and ",
" OR ": " or ",
" NOT ": " not ",
}
def __init__(self):
self.lines = []
self.indent = 1
def emit(self, text=""):
self.lines.append(
(" " * self.indent) + text
)
def translate_expr(self, expr):
expr = f" {expr.strip()} "
for old, new in self.OPERATORS.items():
expr = expr.replace(old, new)
return expr.strip()
def compile_cfset(self, tag):
m = re.search(
r"<cfset\s+(.+?)=(.+?)>",
tag,
re.I | re.S,
)
if not m:
return
name = m.group(1).strip()
expr = m.group(2).strip()
expr = self.translate_expr(expr)
self.emit(
f'context["{name}"] = ({expr})'
)
def compile_cfparam(self, tag):
m_name = re.search(
r'name="([^"]+)"',
tag,
re.I,
)
m_default = re.search(
r'default="([^"]*)"',
tag,
re.I,
)
if not m_name:
return
name = m_name.group(1)
default = "None"
if m_default:
default = m_default.group(1)
default = self.translate_expr(default)
self.emit(
f'if "{name}" not in context:'
)
self.indent += 1
self.emit(
f'context["{name}"] = ({default})'
)
self.indent -= 1
def compile_cfif(self, tag):
m = re.search(
r"<cfif\s+(.+?)>",
tag,
re.I | re.S,
)
if not m:
return
expr = self.translate_expr(
m.group(1)
)
self.emit(
f"if ({expr}):"
)
self.indent += 1
def compile_cfelse(self):
self.indent -= 1
self.emit("else:")
self.indent += 1
def compile_cfendif(self):
self.indent -= 1
def compile_cfloop(self, tag):
index_match = re.search(
r'index="([^"]+)"',
tag,
re.I,
)
from_match = re.search(
r'from="([^"]+)"',
tag,
re.I,
)
to_match = re.search(
r'to="([^"]+)"',
tag,
re.I,
)
if (
not index_match
or not from_match
or not to_match
):
return
index = index_match.group(1)
start = self.translate_expr(
from_match.group(1)
)
end = self.translate_expr(
to_match.group(1)
)
self.emit(
f"for {index} in range(int({start}), int({end}) + 1):"
)
self.indent += 1
self.emit(
f'context["{index}"] = {index}'
)
def compile_endloop(self):
self.indent -= 1
def emit_text(self, text):
if not text:
return
pos = 0
pattern = re.compile(
r"#([A-Za-z_][A-Za-z0-9_]*)#"
)
for m in pattern.finditer(text):
literal = text[pos:m.start()]
if literal:
self.emit(
f"out({literal!r})"
)
name = m.group(1)
self.emit(
f'out(str(context.get("{name}", "")))'
)
pos = m.end()
remainder = text[pos:]
if remainder:
self.emit(
f"out({remainder!r})"
)
def compile(self, source):
self.lines = []
self.lines.append(
"def template(context, out):"
)
tokens = re.split(
r"(<cf.*?>|</cfif>|</cfloop>)",
source,
flags=re.I | re.S,
)
for token in tokens:
if not token:
continue
lower = token.lower().strip()
if lower.startswith("<cfset"):
self.compile_cfset(token)
elif lower.startswith("<cfparam"):
self.compile_cfparam(token)
elif lower.startswith("<cfif"):
self.compile_cfif(token)
elif lower == "<cfelse>":
self.compile_cfelse()
elif lower == "</cfif>":
self.compile_cfendif()
elif lower.startswith("<cfloop"):
self.compile_cfloop(token)
elif lower == "</cfloop>":
self.compile_endloop()
else:
self.emit_text(token)
return "\n".join(self.lines)
def render(source, context=None):
if context is None:
context = {}
compiler = CFMXCompiler()
generated = compiler.compile(source)
namespace = {}
exec(generated, namespace)
result = []
namespace["template"](
context,
result.append
)
return "".join(result)
if __name__ == "__main__":
template = """
<cfparam name="name" default="'Guest'">
<cfset age=21>
<cfif age GTE 18>
Adult: #name#
<cfelse>
Minor: #name#
</cfif>
<cfloop index="i"
from="1"
to="3">
Iteration #i#
</cfloop>
"""
print(
render(template)
)
| Big Idea | Easy, Kinder Meaning |
|---|---|
| CFML stayed in its lane | It did the things it was good at |
| Tags work for simple actions | Tags are great when you do one quick thing |
| Tags don't work for big systems | Tags get confused when things never stop |
| CFML picked determinism and idempotency | It chose jobs that fit its tag style |
| It outlasted the competition | It stayed where it could do a good job |
- https://www.bennadel.com/blog/3682-installing-user-defined-functions-udf-as-an-extension-for-built-in-functions-bif-in-lucee-5-3-2-77.htm
- https://blogs.msdn.microsoft.com/mihansen/2017/08/10/running-coldfusion-in-azure-webapp/
- https://dev.to/mikeborn/five-reasons-to-learn-cf-in-2019-2odc
- https://coldfusion.adobe.com/2019/06/5-reasons-adobe-coldfusion-better-c/
- https://brianklaas.net/aws/coldfusion/2019/06/28/Using-AWS-Step-Functions-In-CFML-Part-13.html
- https://docs.lucee.org/guides/updating-lucee/migrate-from-acf.html
- https://dev.to/mikeborn/yes-coldfusion-is-unpopular-no-i-don-t-care-5f8c
- https://cfdocs.org
- https://foundeo.com/
- https://fixinator.app/
Here are some shared hosting providers that support ColdFusion, Lucee, or Railo:
- Hostek: Known for its excellent support and reliability, Hostek offers shared hosting plans that support ColdFusion and Lucee.
- VivioTech: This provider supports both Lucee and Railo, and has contributed significantly to the open-source CFML community.
- HostMySite: Another reliable option for ColdFusion hosting¹.
- Newtek: Although they have paused offering new ColdFusion support, they still support existing customers¹.
- DailyRazor: Offers shared hosting plans that support ColdFusion¹.
(3) Lucee Shared Hosting - Lucee or Railo | HOSTEK. https://hostek.com/hosting/lucee/vps/lucee-vps-hosting-shared. (4) undefined. https://www.hostmysite.com/. (5) undefined. https://www.newtekwebhosting.com/.
- https://www.cfguide.io/coldfusion-administrator/enterprise-manager-cluster-manager/
- https://www.cfguide.io/coldfusion-administrator/client-variables/
- https://docs.lucee.org/guides/Various/FAQs/technical-FAQs/database-session.html
- https://docs.lucee.org/guides/deploying-lucee-server-apps/locking-down-lucee-server.html
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
- http://modius.io/2016/07/13/lucee-memcached-session-clustering/
- https://www.petefreitag.com/item/861.cfm
- https://fuseless.org/
- https://www.rasia.io/blog/your-cfml-engine-is-a-java-servlet.html
- https://www.bennadel.com/blog/4143-securing-coldfusion-scheduled-tasks-in-a-docker-container-using-lucee-cfml-5-3-8-206.htm
- https://gist.github.com/bennadel/1c4aca56c6e0d8e7e34381a23b4f06b2
- https://www.carehart.org/presentations/Getting%20Started%20With%20CF's%20Docker%20Images-CFSummit%202019.pdf
- http://www.ccfug.org/sites/ccfug/assets/File/presentations/CF%20apps%20to%20dev%20to%20production%20with%20CommandBox%20CFConfig%20Docker.pdf
- https://docs.lucee.org/guides/Various/deploy-AWSElasticBeanstalk.html
- https://docs.aws.amazon.com/cloud9/latest/user-guide/sample-java.html
- https://devcenter.heroku.com/articles/deploying-java-applications-with-the-heroku-maven-plugin
- https://docs.lucee.org/guides/Various/lucee-maven.html
- https://www.oit.va.gov/Services/TRM/ToolPage.aspx?tid=5507
- https://www.hl7.org/sitemap.cfm
- https://www.famu.edu/index.cfm
- https://california.hometownlocator.com/maps/feature-map,ftc,1,fid,226793,n,laird%20slough.cfm
- https://www.southernsoulrnb.com/
- https://www.rv.net/forum/index.cfm/fuseaction/thread/tid/24857964/print/true.cfm
- https://www.soundclick.com/company/about.cfm
- https://techliquidators.com/tl/index.cfm
- https://askjan.org/articles/Workplace-Flu-Vaccination-Requirements-and-the-ADA.cfm
- https://www.petefreitag.com/category/coldfusion.cfm
- https://www.govdeals.com/index.cfm
- https://www.carehart.org/blog/client/index.cfm
- https://www.cfnb.bank/overdraft-and-nsf-fees.cfm
- https://www.mdcfug.com/articles/coldfusion_mx_and_fusebox.cfm
- Lucee vs. ColdFusion vs. Railo - (The Ultimate Battle) - IT Landmark. https://www.itlandmark.com/blog/lucee-vs-coldfusion-vs-railo-which-one-to-choose-and-why/