Loyal Opposition to Const, Private, Freeze, Non-Configurable, Non-Writable...

Quildreen Motta quildreen at gmail.com
Wed Nov 2 11:07:44 PDT 2011

On 02/11/11 15:49, Brendan Eich wrote:
> On Nov 2, 2011, at 9:30 AM, Quildreen Motta wrote:
>> Also, note that `with' makes a whole awesome use-case for `Object.freeze':
> 'with' is gone in ES5 strict, ES6, and beyond -- you knew that, right?
Yep, and I still think it's a sad thing. Not that I use it anyways, the 
performance doesn't allow me to. And we're getting real `let'.

>> ---
>> with (require({'library1': 'lib1'}, {'library2': 'lib2'})) {
>>    lib1.foo(lib2.something)
>> }
> This is still hard to optimize, even with the implied freeze under require.
Hm, not sure I understand why. I'm not a compiler writer though.

> Also, you can't load code dynamically without nesting an event loop and violating run-to-completion, so I'm not sure how such a require would work.
Yes, but `require' could take a plain object out of a map or something, 
it could use a synchronous call. But I don't think that matters much here :3
> This does remind me: JS's "freedom" is Dart's "cannot be tooled" and "inherent performance problems", and without aggressive optimization work it can mean JS is measurably slower for some kinds of code than Dart (or Java).
> ("cannot be tooled" is flat wrong, as past discussion here of static+dynamic/live-system analysis concluded.)
> To "inherent performance problems", I say "feature" and "optimize harder". But it's worth mentioning, especially since you cited 'with', which is a bug that I brought ;-). Stupid-dynamic is just stupid and we should avoid it.
> Freedom without fences and other tools for accountability fails at scale.
I still don't agree with `with' being a failure (perhaps the syntax 
ended up too ambiguous, yeah, and the thing about being able to change 
the shape of the objects and all, but...), I agree with the "optimise 
harder" though.

I wonder if it was the Racket guys who said that languages should indeed 
be dynamic, so compiler writers have more work to do :3

More information about the es-discuss mailing list