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

Compile escripts by default #7348

Merged
merged 1 commit into from
Jun 9, 2023
Merged

Conversation

bjorng
Copy link
Contributor

@bjorng bjorng commented Jun 2, 2023

The current default when running an escript is to interpret it using the erl_eval module. In the ancient times when escript was invented that made sense. Interpretation would be slower and some language constructs would not work, but execution could start immediately without waiting for the compiler to finish.

Nowadays with faster computers it makes less sense.

Therefore, in Erlang/OTP 27, change the default to compile the escript. That will require the escript to be executed by an Erlang system that includes the Erlang compiler.

The current default when running an escript is to interpret it using
the `erl_eval` module. In the ancient times when escript was invented
that made sense. Interpretation would be slower and some language
constructs would not work, but execution could start immediately
without waiting for the compiler to finish.

Nowadays with faster computers it makes less sense.

Therefore, in Erlang/OTP 27, change the default to compile the
escript. That will require the escript to be executed by an Erlang
system that includes the Erlang compiler.
@bjorng bjorng added team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI labels Jun 2, 2023
@bjorng bjorng self-assigned this Jun 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

CT Test Results

       4 files     211 suites   1h 28m 4s ⏱️
3 317 tests 3 220 ✔️   96 💤 1
4 048 runs  3 929 ✔️ 118 💤 1

For more details on these failures, see this check.

Results for commit e1a5d0e.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@bjorng
Copy link
Contributor Author

bjorng commented Jun 2, 2023

I have marked this pull request as a draft because as an potential incompatibility it will have to be approved by the OTP Technical Board.

I also propose that the interpreted mode should be removed in Erlang/OTP 28.

@garazdawi
Copy link
Contributor

Is it a lot of work to keep the interpreted mode as a fallback for when the compiler is not available? In small embedded systems it might still be nice to be able to run escripts without including the compiler in those systems. Maybe even we have escripts in applications that don't today need the compiler to be present?

@bjorng
Copy link
Contributor Author

bjorng commented Jun 2, 2023

@garazdawi No, there is not a lot of ongoing work to keep the interpretation working, but some language construct don't work (see #7257 for an example). Yes, the embedded systems without an compiler could be a reason that we should not remove the possibility to interpret the code.

@bjorng bjorng marked this pull request as ready for review June 9, 2023 08:26
@bjorng bjorng merged commit bfdb324 into erlang:master Jun 9, 2023
@bjorng bjorng deleted the bjorn/stdlib/escript-mode branch September 18, 2023 06:49
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants