Comment

Comment by sync

I'd be afraid of inheriting any codebase that made extensive use of these JS macros.

You really have no idea what this is doing (the canonical example from sweetjs.org):

  class Person {
    constructor(name) {
      this.name = name;
    }

    say(msg) {
      console.log(this.name + " says: " + msg);
    }
  }
It's not javascript -- it's your own made up "language" of macros.

I do believe with a steady hand this could lead to some great things, but the example on sweetjs.org seems rather heavy handed. Having different `class` macro definitions between codebases that use sweet.js will devolve into madness.

parent sync 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton