es-discuss Digest, Vol 106, Issue 46

Andrea Giammarchi andrea.giammarchi at gmail.com
Wed Dec 16 14:33:14 UTC 2015


Chiming in only with one question: is interoperability between PL and
different environments a concern at all?

I think having unique identifiers like Symbols is a better solution too but
right yesterday I've made a PR to convert V8 Enum type to GObject enums
using its integer value [1] 'cause that's how it also work the other way
round [2].

How would a JS Symbol as enumerable be represented in Emscripten generated
code or how could Int32 enum based PL transpile their enums to JS?

Maybe I am overlooking at this and it's not a real issue?

Regards

[1]
https://github.com/WebReflection/gnode/commit/56c5801866452c1e4973ed0c42f80dcda9d3d8c6
[2]
https://github.com/WebReflection/gnode/blob/master/src/value.cc#L279-L280


On Wed, Dec 16, 2015 at 1:57 PM, Brendan Eich <brendan.eich at gmail.com>
wrote:

> A union is a kind of sum type -- either this or that. Order may matter for
> reflective use-cases, indeed. That's a good point. Whether symbol values by
> default are best wants a bit more debate too, I think.
>
> /be
>
> On Wed, Dec 16, 2015 at 8:53 AM Coroutines <coroutines at gmail.com> wrote:
>
>> On Wed, Dec 16, 2015 at 5:44 AM, Brendan Eich <brendan.eich at gmail.com>
>> wrote:
>> > `enum` has precedent -- C-like languages indeed use integers by
>> default, but
>> > see Rust for a generalized form:
>> https://doc.rust-lang.org/book/enums.html
>> > -- for a category-theory "sum" type and IMHO handily beats `sym` or
>> `sum`.
>>
>> I just mean that using `enum` to define symbols/identifiers sounds
>> odd, as enum is short for 'enumerate' no?  We wouldn't be enumerating
>> symbols as that suggests order behind the symbol
>> identifiers/references, imo :>
>>
>> Rust's enum/sum value type sounds like a typed union..  the type flag
>> is just hidden?
>>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20151216/26d02d4c/attachment.html>


More information about the es-discuss mailing list