Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: built-in or builtin #1947

Open
annevk opened this issue Apr 14, 2020 · 6 comments
Open

Editorial: built-in or builtin #1947

annevk opened this issue Apr 14, 2020 · 6 comments

Comments

@annevk
Copy link
Member

annevk commented Apr 14, 2020

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 whatwg/webidl#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
Copy link
Member

ljharb commented Apr 14, 2020

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
Copy link
Contributor

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
Copy link
Member

rkirsling commented Apr 14, 2020

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
Copy link
Collaborator

jmdyck commented Apr 14, 2020

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

Specifically:

  • CreateBuiltinFunction,
  • RegExpBuiltinExec, and
  • _builtinTag_ in the algorithm for Object.prototype.toString().

That's all.

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

@bakkot
Copy link
Contributor

bakkot commented Apr 15, 2020

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
Copy link
Member

rkirsling commented Apr 15, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants