News for hackers. Stuff that matters.
Re:Stop Writing JavaScript Compilers, Make Macros Instead by windsurfer on Wednesday January 08, 2014 @01:36PM (#7025466)
Do you know exactly what your compilers are doing? Do you open your compiled C programs in a disassembler? I don't think worrying about "correctness of the implementation" is constructive.
Re:Stop Writing JavaScript Compilers, Make Macros Instead by nawitus on Wednesday January 08, 2014 @01:43PM (#7025521)
It doesn't matter what the assembly looks like, if the definition of language is well-defined. With macros this is not true, different 'macro' definitions probaly work in a lot of different ways.

It's true that different compilers and interpreters sometimes do slightly different things, but atleast there's a standard which should improve over time. I don't see that happening with macros.

Not sure how modularity is achieved with macros either.

Re:Stop Writing JavaScript Compilers, Make Macros Instead by michaelmior on Wednesday January 08, 2014 @02:54PM (#7026069)
Macros CAN be well-defined, but I think the cherry picking of macros mentioned in the article leads to a "language" that is ill-defined vs picking up CoffeeScript or LiveScript. The idea of implementing ES6 via macros is pretty attractive though.
Re:Stop Writing JavaScript Compilers, Make Macros Instead by windsurfer on Wednesday January 08, 2014 @02:48PM (#7026027)
Why can't macros be well defined?
Re:Stop Writing JavaScript Compilers, Make Macros Instead by nawitus on Wednesday January 08, 2014 @02:55PM (#7026077)
They can be, but rarely are.
Re:Stop Writing JavaScript Compilers, Make Macros Instead by RussianCow on Wednesday January 08, 2014 @01:42PM (#7025517)
I think it's less about correctness of implementation and more about abuse of the interface. Not that I agree, but I think it's a completely valid criticism, in the same way that you could argue against operator overloading in OOP languages.
Re:Stop Writing JavaScript Compilers, Make Macros Instead by EpicEng on Wednesday January 08, 2014 @10:12PM (#7028508)
Ummm... yes? Sometimes you have to. I was looking into a bug about a year ago that was caused by the compiler I was using (Intel) wasn't properly saving the return address in some situations. This led to seemingly random crashes and thrashed memory.

So yeah, "correctness of implementation" is something to worry about, you just haven't had to (yet).