4 ms·
Slightly off-topic, but the OP's closing thoughts make great advice to anyone commenting on / reacting to some new technology: I ask that you think hard about
by samstokes 12y ago
Slightly off-topic, but the OP's closing thoughts make great advice to anyone commenting on / reacting to some new technology:
I ask that you think hard about sweet.js. Give it 5 minutes. Maybe give it a couple of hours. Play around with it: set up a gulp watcher, install some macros from npm, and use it. Don't push back against it unless you actually understand the problem we are trying to solve. Many arguments that people give don't make sense (but some of them do!).
Regardless, even if you think this isn't the right approach, it's certainly a valid one. One of the most troubling things about the software industry to me is how vicious we can be to one another, so please be constructive.
So often commenters seem to be people who've never tried the technology in question reacting to imagined abuses ("Monkeypatching? I'd never allow that in production!").
- grayrest 12y agoThe 5 minutes line comes from: https://signalvnoise.com/posts/3124-give-it-five-minutes https://signalvnoise.com/posts/3124-give-it-five-minutes It's fairly popular in the React community because everybody sees JSX and is like "bleh" and rejects the tech out of hand, which is disappointing because React is IMO the most important advance in frontend development since the DOM Inspector or at least since jQuery.
- spion 12y agoThe problem with jsx and sweet.js is the lack of tooling. For example, TernJS (a static analysis engine I use in emacs) will never understand either, so no auto-complete or hints. Is such tooling even possible for something like sweet.js?
- deleted 12y ago[deleted]
- jlongster 12y agoTern works perfectly well with sweet.js. It uses loose parsing so it basically just ignores the areas that it can't understand. For the most part, you still get all the info you used to have. Generally you don't use macros that are overly aggressive in modifying scope, or changing the basic rules of JS that tern looks for. You will not get autocompleting on expressions that expand with macros, no. But you could easily add a plugin to tern that tells it the rules for that syntax if you really wanted to.
- klibertp 12y agoI can live without semantic auto-complete, dabbrev works well enough for most simple cases. It's lack of syntax highlighting and signalling parse errors that bother me. Macros in Racket are as awesome as they are because they are deeply integrated with DrRacket. Having s-exps based syntax helps, but that's not a prerequisite - DrRacket handles #langs which are not based on sexps too. It's one of Racket's goals to let you create your own language and make it work with syntax-highlighting and auto-completion (and more) automatically. That's what makes Racket absolutely awesome for experimenting with languages. Sweet.js is young and it's possible it will get editor support with plugins later. For now, however, the lack of such support makes the experience worse than CoffeeScript or LiveScript or ClojureScript. Which is a shame, because extensibility granted by powerful macro system is very desirable in JS and would render many of compile-to-JS languages redundant, while allowing better composability. In short I like sweet.js idea very much, I played with it a bit, but I unfortunately will have to wait for better tooling before using it in production.