Re:The Opa Framework for JavaScript
by maxhowell on Tuesday June 18, 2013 @12:46PM
(#5900388)
Recently I wrote a less overwhelming pre-compiler that allows you type HTML inline with your Javascript, may be worth a look: http://mxcl.github.io/bs BullScript’s goal is just to make writing JS a little nicer, but not to be some whole new language.
[ Parent
| on HN ]
Somewhat silly question... why not write BSC in JS? I mean, this seems like something that would be a natural fit in a NodeJS environment, and tying into NPM similar to CoffeeScript, Less etc.
I don't mean to come across as an ass, just curious. Though, I do think what you are doing could be a natural extension to CoffeeScript itself.
Also, I would suggest having an htmlEncode(variable) by default, I know that htmlEncode isn't a built-in JS method, but you should want to escape html entities.
Yes with hindsight I wish I had written it in JS, but writing the BS compiler was something I wanted to get done fast, and I'm more proficient with Ruby.
BS has the #x{foo} syntax for htmlEncoding, or did you mean that should just be the default?
I didn't notice the #x{foo}, though was thinking that should be the default (safe-first), and if you want unsafe/raw have that be explicit.
Re:The Opa Framework for JavaScript
by pepijndevos on Tuesday June 18, 2013 @03:07PM
(#5901297)
So it's like PHP for JS?