cftag2cfscript – The cftag to cfscript converter for Coldfusion

Just uploaded my new project cftag2cfscript to github this morning.

With the arrival of Coldfusion 9 we can finally build our cfcs in cfscript. I’ve found that there can be a significant speed increase when converting an existing tag based cfc to cfscript. YMMV of course. Others may want to convert legacy cfcs to cfscript because they prefer writing in cfscript. Whatever your reason is for wanting to convert cf tags in to script cftag2cfscript is here to help.

Converting tag-based CF to script based CF is time consuming. This project aims to make it dead simple. Its not there yet, but maybe with your help we can reach that goal.

Checkout cftag2cfscript on Github

2 thoughts on “cftag2cfscript – The cftag to cfscript converter for Coldfusion”

  1. I stumbled upon your Github project while doing a Google search for “cfscript converter”. It was the top hit.

    I was searching because I wanted to see if anyone out there had started something similar to my project below.

    http://josegaldamez.com/cfscript-converter/

    My CF tags to CFScript converter is very rudimentary at this stage. It’s all done using JavaScript. Rather than convert the tags to XML I use regular expression patterns to do various search and replace operations.

    Even though I’m still quite new to Git I’d like to see if there’s a way I can contribute to your project. I’m a huge fan of CFScript over CF tag syntax, and anything to make the transition smoother is a good thing.

  2. Hi Jose!

    I would gladly welcome your help on the project. You can fork cftag2cfscript on Github and then use that branch to continue development. If you have updates please make a pull request and I will merge them back in. I worked on cftag2cfscript for a particular project that has long been finished and haven’t had a chance to get back to it. It would be great to know someone else is keeping cftag2cfscript going!

    RegEx is a great tool, but its not a language parser and at a certain point its not going to be able to have enough information to make a straight search and replace possible.

    Using XML as an intermediate step seemed like a good choice. Its easy to switch most CF tags to be fully XML compliant and the XML can hold all the attributes and any extra meta-data needed to render the final code. This allowed me to tokenize the CF tag documents quickly and build conversion code that only had to focus on small bits of XML.

    Its not without drawbacks however. XML is brittle and the XML parser built-in to CF will fail if the XML does not fully validate. Its also memory intensive once you get past a certain size.

    Converting cftags into cfscript was a lot of fun! I was disappointed to discover that Adobe hasn’t actually implemented all CF tags in CF script as I was lead to believe however.

    If you choose to fork cftag2cfscript please don’t hesitate to contact me with any questions you may have.

Leave a Reply

Your email address will not be published. Required fields are marked *