Live data from Hacker News

Sweet.js - Sweeten your Javascript (by Mozilla)

github.com

11–20 of 30 posts

Re: Sweet.js - Sweeten your Javascript (by Mozilla)

#11
Interesting and impressive from a technological perspective but wouldn't sweet.js make your code harder to debug? Macros in C are hell. Have you seen functions with ifdef littered everywhere? Why would anyone want this in JavaScript? JavaScript is dynamic enough to not need a crutch like this in my opinion. At least with CoffeeScript you're not mixing contexts. Everything is either CoffeeScript or JavaScript.

Re: Sweet.js - Sweeten your Javascript (by Mozilla)

#12

Interesting and impressive from a technological perspective but wouldn't sweet.js make your code harder to debug? Macros in C are hell. Have you seen functions with ifdef littered everywhere? Why would anyone want this in JavaScript? JavaScript is dynamic enough to not need a crutch like this in my opinion. At least with CoffeeScript you're not mixing contexts. Everything is either CoffeeScript or JavaScript.

Macros in C are a far cry from hygienic macros: http://en.m.wikipedia.org/wiki/Hygienic_macro.

Re: Sweet.js - Sweeten your Javascript (by Mozilla)

#13
post #10

LLJS and Now Sweet JS Seems like mozilla is trying to answer TypeScript. Which is really good.

But they are not solving the same problem at all! This should be a superset of TypeScript. Since TypeScript is a superset of JavaScript, you would not be forced to use TypeScript if you didn't want to. But how can I use this with TypeScript currently?

Re: Sweet.js - Sweeten your Javascript (by Mozilla)

#14
post #10

LLJS and Now Sweet JS Seems like mozilla is trying to answer TypeScript. Which is really good.

But they are not solving the same problem at all! This should be a superset of TypeScript. Since TypeScript is a superset of JavaScript, you would not be forced to use TypeScript if you didn't want to. But how can I use this with TypeScript currently?

No. I never want to say TypeScript is bad or not. But I wan't to say is, Mozilla is trying to do something competitive with TypeScript or may be with CoffeScript.

Which is really good.

Re: Sweet.js - Sweeten your Javascript (by Mozilla)

#15

Reading about Sweet.js made me really, really want such a thing in Python. I recognise that such a thing would run completely counter to Python's 'no magic' cultural values, but structural search-and-replace seems such an intoxicatingly powerful tool, I'd like to at least have the option to abuse it.

So use Perl :)

The thing about Perl is that there is supposed to be more than one way to do it. Which enables you to mix-and-match different paradigms in a way that the Python philosophy doesn't seem to welcome.

Or just use a Lisp.

Re: Sweet.js - Sweeten your Javascript (by Mozilla)

#16
post #14

Earlier quoted context omitted.

But they are not solving the same problem at all! This should be a superset of TypeScript. Since TypeScript is a superset of JavaScript, you would not be forced to use TypeScript if you didn't want to. But how can I use this with TypeScript currently?

No. I never want to say TypeScript is bad or not. But I wan't to say is, Mozilla is trying to do something competitive with TypeScript or may be with CoffeScript. Which is really good.

Mozilla has been working on this since before Aug 1: https://github.com/mozilla/sweet.js/commit/de15

I don't think they know anything about TypeScript before it was made publicly available, which happened a week ago or so.

Re: Sweet.js - Sweeten your Javascript (by Mozilla)

#17
post #14

Earlier quoted context omitted.

No. I never want to say TypeScript is bad or not. But I wan't to say is, Mozilla is trying to do something competitive with TypeScript or may be with CoffeScript. Which is really good.

Mozilla has been working on this since before Aug 1: https://github.com/mozilla/sweet.js/commit/de15 I don't think they know anything about TypeScript before it was made publicly available, which happened a week ago or so.

Okay. I think this discussion leads to something not useful. :)

We have CofeeScript, TypeScript, LLJS (have no idea when this will be usefull), Sweet JS.

So It's about choices. That is good.

Re: Sweet.js - Sweeten your Javascript (by Mozilla)

#18

Reading about Sweet.js made me really, really want such a thing in Python. I recognise that such a thing would run completely counter to Python's 'no magic' cultural values, but structural search-and-replace seems such an intoxicatingly powerful tool, I'd like to at least have the option to abuse it.

So use Perl :) The thing about Perl is that there is supposed to be more than one way to do it. Which enables you to mix-and-match different paradigms in a way that the Python philosophy doesn't seem to welcome. Or just use a Lisp.

Perl 6 even comes with hygienic macros, I believe. That should be much nicer than source filters in Perl 5.

Re: Sweet.js - Sweeten your Javascript (by Mozilla)

#19

Interesting and impressive from a technological perspective but wouldn't sweet.js make your code harder to debug? Macros in C are hell. Have you seen functions with ifdef littered everywhere? Why would anyone want this in JavaScript? JavaScript is dynamic enough to not need a crutch like this in my opinion. At least with CoffeeScript you're not mixing contexts. Everything is either CoffeeScript or JavaScript.

Wait, why are you talking about C?

Re: Sweet.js - Sweeten your Javascript (by Mozilla)

#20

Reading about Sweet.js made me really, really want such a thing in Python. I recognise that such a thing would run completely counter to Python's 'no magic' cultural values, but structural search-and-replace seems such an intoxicatingly powerful tool, I'd like to at least have the option to abuse it.

I'd suggest that metaclasses are Python's 'equivalent' for magically mutating things.
Post reply on HN