News for hackers. Stuff that matters.
Re:ES6 in Depth – Symbols by espadrine on Friday June 12, 2015 @06:20AM (#9704969)
If you think that this language feature has no equivalent in your favorite language, it is similar to Ruby's :symbol, where it is mostly used as keys to their hash tables (they're implemented with hashes internally).

Common Lisp has something even closer for its macro system. When you write code that writes code, you often need to create new variable names that won't collide or shadow anything. `(gensym)` does that: http://www.lispworks.com/documentation/lw50/CLHS/Body/f_gens....

Here's a list of languages with support for symbols. You will see even Objective-C has it: https://en.wikipedia.org/wiki/Symbol_%28programming%29#Suppo....

I'd be curious to learn how it is implemented in JS engines.

Re:ES6 in Depth – Symbols by inglor on Friday June 12, 2015 @06:28AM (#9704992)
Like a property basically - except the key is not a string and is known to the engine. This is both simple and uses existing JIT facilities. Symbol property access isn't particularly slower than regular access this way too.

See http://blog.peschla.net/doxygen/v8_chromium_r157275/classv8_... - it's

Re:ES6 in Depth – Symbols by masklinn on Friday June 12, 2015 @07:42AM (#9705246)
> Here's a list of languages with support for symbols. You will see even Objective-C has it: https://en.wikipedia.org/wiki/Symbol_%28programming%29#Suppo....

None of the symbols in that table match the purpose and use case for `new Symbol`, though gensym does.