Reputation: 747
I am new to CoffeeScript and I would like to experiment with it using SublimeText.
Ideally I would like to emulate the functionality of Fiddle Salad's excellent online editor - specifically I would like to see the OUTPUT - i.e. so that
console.log 'Hello World'
actually displays 'Hello World' in the console...
I am on Windows and have followed these instructions and have used the following 'build' file:
{
"cmd": ["coffee.cmd","-c","$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.coffee"
}
This gets me as far as compiling Coffee files to JavaScript, but no further.
Not incidentally, I can't help wondering why this is so hard. I am keen to learn and (until this point) I did not consider myself a moron, but it seems that web app development is almost deliberately esoteric and overwrought. Help appreciated.
Upvotes: 2
Views: 169
Reputation: 25728
"cmd": ["coffee.cmd","-c","$file"],
The -c in this command stands for compile. So it is doing what you've asked it to do. If you want live responsese, what you really want is an REPL (Run-Eval=Print Loop).
Here's a sublime text plugin that supports coffeescript: SublimeREPL
You also can do the same thing on the command line by just calling the coffee
executable.
Not incidentally, I can't help wondering why this is so hard. I am keen to learn and (until this point) I did not consider myself a moron, but it seems that web app development is almost deliberately esoteric and overwrought. Help appreciated.
As far as this goes, you're trying to use a language that compiles down to another language, inside an editor that is designed to have a minimal but extensible base, and want live editing capabilities. Thats 3 levels of complication/configuration that are not in any way required for web app development. There's nothing wrong with that persay. Its a totally valid setup to be developing on. But most of your complication seems to come from these choices rather than web development in general.
If you want to do some quick web development with instant feedback using coffeescript, consider using one of these online editors that allow you to ignore all this configuration/complexity
If you want more IDE features without the configuration complexity consider using an IDE like Webstorm
If you don't want to deal with the complication of compiling down to another language, consider starting with Javascript instead of coffeescript.
You of course don't have to do any of these things, but they might reduce some of the complexity you're complaining of for your use case.
Upvotes: 1