F.E.L.T.

Functionally Equivalent Language Translation

FELT... What is it ?

FELT is an acronym for... Functionally Equivalent Language Translation.

  1. Is it LISP? No. It may look like LISP because it is based on the same s-expressions that LISP uses but that's pretty much as far as it goes.

  2. Is it functional or procedural? Both. And neither. It's totally dependant on how you write it and what language you target. FELT supports both the creation of and use of classes for any OO language it supports. It seamlessly integrates into and with any existing code because it produces the same code as your libraries!

  3. Is is statically typed or dynamically typed? Both. And neither. Again, it entirely depends on your chosen output language. FELT is the messenger not the message. Although...

Enough already, my head hurts! The real clue is in the first two words of the acronym: "functionally equivalent". Let's just bullet point some things that FELT definitely is and isn't and then explain exactly what it's all about, what it hopes to do for you (make life easier) and how you go about using it in your next killer project / hum-drum day job. It's certainly not rocket science; I am not a rocket scientist. If I was this page might well take off or explode or something dangerous like that.

FELT is...

  • Language neutral!?
  • Dependant on nothing. No external libraries. Period.
  • Very simple to learn and become productive with.
  • Flexible and extensible (currently in PHP).
  • Capable of generating any conceivable output.
  • Limited only by your own imagination and ingenuity!

FELT isn't...

  • Object oriented.
  • Functional.
  • Loosely typed.
  • Statically typed.
  • Byte compiled, interpreted or compiled.
  • Anything remotely resembling a "real" language!

SO, FELT is not a true language in the sense that it generates byte compiled output or natively compiled output. No, all that FELT does is to translate a common syntactical form based on LISP s-expressions into a target language selected from whatever flavours are available. It comes with PHP, Javacript and CSS out of the box as it was the desire to be able to code PHP as LISP that first got me started on this little toy. I am also hard at work on producing Java and Objective-C back ends as well.

http://www.miutopia.com // Open Clipart

The other thing I personally wanted to be able to do was code the "business logic" for mobile phone applications once and once only and FELT is also the culmination of that dream; cross platform development using LISP like syntax. It really started to annoy me that I had to essentially write everything twice, and at the time Apple were seemingly coming down hard on people using technologies other than XCode / Cocoa to create iOS applications. With FELT, you will never know! Our little secret.

Is it useful?

Like anything in life it's as useful as you personally find it.

I use it every day now for all of my PHP and JavaScript development that I do for myself.

For reasons that are probably way too personal to explain, I find the all pervading uniformity of syntax means I seem to stay in the zone better and make less silly coding errors. Remember, FELT generates PHP for you so you don't have to. It also generates Javascript from the same source code if you ask it... all with no effort on your part. That's not to say it will work of course! You are responsible for managing how different functions are managed on different targets; for example, in PHP you have the function sprintf but in Javascript there is no direct equivalent so therefore you would have to write a function to do the same job. In other words... FELT translates its instructions into a target language but cannot and does not know how to make sure that any function in Language-A maps to the equivalent function in Language-B... that would be a mammoth task.

FELT does provide an instruction, (#f:when X) that expands its contents only when target language X is selected which is one way of managing such differences. The other of course is to keep target specific stuff in separate files and let your build process invoke the FELT translation as and when it needs to.

FELT will make you think about what you are doing in a very different way than you would normally find yourself working but in my opinion it is good for you! With your help I aim to build a library of generic code that can be ported to any selected platform in the future. Stay tuned for that one, could be a while but imagine never having to code anything again from scratch in language X, even if language X hasn't been invented yet! By creating a code-base of hand-crafted FELT routines, all you need to do is create a back-end coder for language X and KAPOW! ...you are in business already.

Think once, deploy anywhere, within reason!

You can use FELT to develop a PHP/Javascript powered site (like this one!) and use the same language to do both. Of course, you have to understand that it merely translates what you type into the chosen language and therefore it is highly likely that at some point the target language may complain. Drive carefully and always bear in mind that, while the code may translate it may not compile if you have done something 'interesting' in the FELT source.

This entire site is written with 99.9% FELT code, if in doubt, start reading the source!

Home Page Tell me how to get started!