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 asm stmt for js target #23149

Merged
merged 5 commits into from
Jan 2, 2024
Merged

Conversation

ASVIEST
Copy link
Contributor

@ASVIEST ASVIEST commented Jan 1, 2024

why ?

  • We already have an emit that does the same thing
  • The name asm itself is a bit confusing, you might think it's an alias for asm.js or something else.
  • The asm keyword is used differently on different compiler targets (it makes it inexpressive).
  • Does anyone (other than some compiler libraries) use asm instead of emit ? If yes, it's a bit strange to use asm somewhere and emit somewhere. By making the asm keyword for js target deprecated, there would be even less use of the asm keyword for js target, reducing the amount of confusion.
  • New users might accidentally use a non-universal approach via the asm keyword instead of emit, and then when they learn about asm, try to figure out what the differences are.

see https://forum.nim-lang.org/t/10821

@Araq
Copy link
Member

Araq commented Jan 1, 2024

Tests are red btw.

@ASVIEST
Copy link
Contributor Author

ASVIEST commented Jan 1, 2024

The standard library had asm instead of emit, and the tester reacted to DeprecationWarning, now it should pass the tests.

compiler/jsgen.nim Outdated Show resolved Hide resolved
@Araq Araq added the merge_when_passes_CI mergeable once green label Jan 1, 2024
@Araq Araq merged commit 20d79c9 into nim-lang:devel Jan 2, 2024
19 checks passed
Copy link
Contributor

github-actions bot commented Jan 2, 2024

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 20d79c9

Hint: mm: orc; opt: speed; options: -d:release
177641 lines; 7.626s; 768.129MiB peakmem

@ASVIEST ASVIEST deleted the deprecate-js-asm branch January 2, 2024 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge_when_passes_CI mergeable once green
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants