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

Deprecate "builtin" external language #2697

Merged
merged 6 commits into from
Dec 15, 2020

Conversation

henrikt-ma
Copy link
Collaborator

@henrikt-ma henrikt-ma commented Oct 30, 2020

Fixes #2662

This combines the two decided changes:

  • Only mentioning Modelica.Math non-normatively.
  • Deprecating the "builtin" external language.

With the deprecation of the "builtin" external language, it no longer makes sense to refer to these as the built-in mathematical functions, so they were renamed the elementary mathematical functions.

@@ -1712,14 +1712,14 @@ \section{External Function Interface}\label{external-function-interface}
This is just as for any other function. The components in the protected part allow local variables for temporary storage to be declared.
\end{nonnormative}

The \lstinline!language-specification! must currently be one of \lstinline!"builtin"!, \lstinline!"C"!, \lstinline!"C..."! (for one of the specific C standards like C89, C99, and C11 -- specifying
The \lstinline!language-specification! must currently be one of \lstinline!"builtin"! (deprecated), \lstinline!"C"!, \lstinline!"C..."! (for one of the specific C standards like C89, C99, and C11 -- specifying
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only understood that we deprecated that these functions were builtin - not the entire concept of external "builtin".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. If that was unclear I suggest that we ask for a clarifying poll between meetings.

To me, it seems strange to keep the concept if we don't see a use for it (which would be why it was deprecated for the current set of functions). Another reason to get rid of the unused concept is that the concept uses problematic terminology; it doesn't match my expectations at all that we would have a language without any built-in functions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if you instead skip that deprecated and replace the next one by something like the following:

The \lstinline!"builtin"! specification is deprecated for the only case where it is specified: the elementary mathematical functions described in \cref{built-in-mathematical-functions-and-external-built-in-functions}.

To me that deprecation is as strong.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not as strong, because only deprecating the current uses does neither allow simplification of terminology (I'd like to consider all of the functions described in the specification as "built in"), nor point in the direction of a Modelica language simplification.

However, given that there seems to have been misunderstandings regarding what we were polling on in the meeting, I still think we should do another poll – it wouldn't be right to describe "builtin" as deprecated even if I was able to convince you, as long as this is not how the poll was understood by the rest of the group.

Copy link
Collaborator

@HansOlsson HansOlsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apart from the difference in what is deprecated it looks good.

that it relies on the C standard library of that version) or \lstinline!"FORTRAN 77"!. Unless the external language is specified, it is assumed to be \lstinline!"C"!.

\begin{nonnormative}
The intended use of e.g.\ C99 is to detect if the user tries to link with a C99-function using a C89 compiler.
\end{nonnormative}

The \lstinline!"builtin"! specification is only used for functions that are defined
The deprecated \lstinline!"builtin"! specification is only used for functions that are defined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to specify "builtin" as being a tool-specific options that does not offer portability between tools. Perhaps:

The \lstinline!"builtin"! language specification has implementation-defined results and has been deprecated in order to promote interoperability between tools.
\begin{nonnormative}
Existing code using the \lstinline!"builtin"! language specification typically mimics the built-in operator \Cref{ref-to-operators-section} with the same name and tools are recommended to continue supporting this for the time being.
\end{nonnormative}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that introduce a different meaning at the same time as it is deprecated? I mean, the original intention was never to have different results depending on implementation, right? I find the next sentence in the text a pretty good explanation of what it is:

The external-function call mechanism for "builtin" functions is implementation-defined.

Also, describing it as a tool-specific option make it sound as if "builtin" is what tools are expected to use when having a tool-specific external interface. I think it makes more sense to use a non-standardized tool-specific name for the external language in this case, so that it is clear that the function is not expected to exist in other tools.

Having some non-normative text that explains a deprecated concept seems meaningful, but I don't think we should say something like this about every deprecated functionality we have:

and tools are recommended to continue supporting this for the time being

I mean, being deprecated should always be read as being required for tools to implement, but that library authors should stop using it as it is planned for removal in some future version of the specification.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a reference to the section where "builtin" is used.

@HansOlsson HansOlsson added this to the Phone2020-6 milestone Dec 10, 2020
@HansOlsson
Copy link
Collaborator

Options to choose from:

  1. Deprecate external "builtin" completely.
  2. Deprecate existing standardized uses of external "builtin" (the ones in Modelica.Math), but don't deprecate external "builtin" itself.
  3. State that external "builtin" is tool-dependent.

@HansOlsson
Copy link
Collaborator

1 Daeoh, Henrik, Martin, Quentin, Stephan
2 Hans
3 Elena
Gerd Abstain

Go for 1.

Copy link
Collaborator

@HansOlsson HansOlsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok according to new decision.

@HansOlsson HansOlsson merged commit 7b17020 into modelica:master Dec 15, 2020
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

Successfully merging this pull request may close these issues.

Unexpected mention of Modelica.Math in chapter 'Operators and Expressions'
3 participants