tc39 / ecma262

Status, process, and documents for ECMA-262
https://tc39.es/ecma262/
Other
15.03k stars 1.28k forks source link

Editorial: built-in or builtin #1947

Open annevk opened 4 years ago

annevk commented 4 years ago

We'd like the web platform to align with ECMAScript, but ECMAScript is inconsistent. I have a mild preference for builtin as English tends to drop hyphens over time and it's nice to be future proof.

A decision here tentatively blocks https://github.com/heycam/webidl/pull/870 so it'd be nice if we could reach a somewhat speedy resolution even if it takes a while for ECMAScript itself to change. (I realize this might be tricky though for what is in essence a bikeshed matter.)

cc @domenic

ljharb commented 4 years ago

My intuition matches Domenic's - that built-in is an adjective and builtin is a noun, but I haven't checked the spec to see if that intuition holds.

claudepache commented 4 years ago

but ECMAScript is inconsistent

I see no occurrence of “builtin”, only “built-in”, in ECMA 262 text (where the word is used sometimes as a name (including three “built-ins”), more often as an adjective). The only inconsistency is in variable and operation names such as “CreateBuiltinFunction”, which could be renamed as “CreateBuiltInFunction”.

rkirsling commented 4 years ago

As another data point, I often have to remind myself that test262 has a built-ins directory, since JSC has a builtins directory. 😅

Edit: Looks like V8 also has a builtins directory, while SM has builtin (which for present purposes is the same).

jmdyck commented 4 years ago

The only inconsistency is in variable and operation names such as “CreateBuiltinFunction”

Specifically:

That's all.

(I think the spec's been pretty consistent on this since the first edition.)

bakkot commented 4 years ago

My intuition matches Domenic's - that built-in is an adjective and builtin is a noun, but I haven't checked the spec to see if that intuition holds.

The spec uses "built-in" as a noun exactly three times, all in the Introduction, and does not ever use "builtin" either way (with the above-mentioned exceptions). All other uses are as adjectives.

Personally my preference would be to avoid using the noun form entirely, which avoids the issue.

rkirsling commented 4 years ago

Note that even if we change CreateBuiltinFunction and RegExpBuiltinExec, _builtinTag_ is not a "built-in tag" (i.e., a tag that's built in), it's the tag for a builtin.