Hacker News new | ask | show | jobs
by Sephr 6239 days ago
IMO, a better MIME type would be application/socks+ecmascript or application/socks+javascript instead of application/javascript-socks. That looks closer to how content types that are built on XML have their MIME types. For example, XHTML's MIME type is application/xhtml+xml, not application/xml-xhtml.

Also, a shoes-like syntax is already available in JavaScript, though it would be very hard to utilize as-is (in <JS 1.7, wrap in a function and use `var' instead of `let'):

    app: {
      stack: {
        para("Foo 1"); // para as a function
        para: "Foo 2"; // para as a label
        button: {
          let bar = new Button("Bar");
          bar.onclick = function() { alert("Baz!") }
        };
        flow: {
          style: ({ // CSS block
            color: "red",
            after: {
              content: "!"
            }
          });
          para("This is red and ends with an exclamation point");
        }
      }
    }
1 comments

thanks a lot for your insight. will look into fixing those in future releases