Alternative to JS events that can be later compiled into JS?

Could you offer alternative to usage of JS which has many pitfalls (famous wat talk), like CoffeeScript or even Dart (both of which can be compiled into regular JS)?

I don’t say to remove JS, just add additional, less WTF-prone option.