Migrating to DMD as a Library with D-Scanner

d scanner migrating from libdparse n.w
1 / 34
Embed
Share

"Explore the journey of migrating from libdparse to using DMD as a library with D-Scanner. Learn about D-Scanner, its architecture, objectives, benefits, and the process of integrating the D Compiler as a library. Discover the significance and advantages of this transition for your projects and code analysis." (394 characters)

  • D-Scanner
  • DMD
  • Compiler Library
  • Code Analysis

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. D-scanner: Migrating from libdparse to DMD-as-a-library

  2. Just graduated @ POLITEHNICA Bucharest Computer Science & Engineering About me 2+ years @ Adobe Mostly in the JVM world Got into D through D-Scanner 2

  3. Introduction 3

  4. What is D-Scanner? Static code analysis tool Bad practices, style checks 50+ code checks 4

  5. D-Scanner architecture D-Scanner Libdparse Static analysis checks Lexical Analysis Warnings Syntactic Analysis Source code Visitors AST 5

  6. Objective Dmd as a library D-Scanner Libdparse Static analysis checks Lexical Analysis Lexical Analysis Syntactic Analysis Warnings Syntactic Analysis Semantic Analysis Source code Visitors AST 6

  7. Why DMD as a library? 7

  8. Easier to tackle compiler updates Libdparse Implement DIP 9999 Update library version Replicate DIP 9999 DMD as a library D-Scanner 8

  9. Semantic analysis Hard to perform Already implemented Allows more comprehensible checks 9

  10. Benefits for dmd as a library Dmd as a library is still in its early stages The compiler interface changes Use in an important projects, gain useful insights 10

  11. What has been done 11

  12. Lucian D nescu DConf '22: Integrating the D Compiler as a Library in D-Scanner https://www.youtube.co m/watch?v=JYkb3PjIn4 c 12

  13. Where I started Work required A FEW OTHER CHECKS STARTED WITH PRS OPEN CODE 24 / 54 CHECKS ALREADY MIGRATED INFRASTRUCTURE FOR DMD AS A LIBRARY Work completed Work left 13

  14. What Ive done Work required Finished migrating all checks Some maintenance work Work already completed Work completed by me Work left 14

  15. Execution time ~15% 15

  16. What Ill show you WORKFLOW DMD AS A LIBRARY CHALLENGES KEEPING UP WITH THE UPSTREAM 16

  17. Workflow 17

  18. Upstream fork MAKEFILE DUB FILE 18

  19. Migrated checks Migration process Other areas parse module DMD parse module Code Code should Run DMD Select checks Select checks should Run Run checks Run checks analyze DMD analyze 19

  20. Testing pipeline Integration tests Build Unit tests 20

  21. Dmd as a library challenges 21

  22. Not always intuitive NULL 22

  23. D strings and dmd as a library 23

  24. Deleted checks FloatOperatorCheck CommaExpressionCheck IfStatementCheck DuplicateAttributeCheck 24

  25. Keeping up with the upstream 25

  26. Rebasing 26

  27. Dmd as a library updates 27

  28. Dmd as a library updates 28

  29. GDC Issue 29

  30. Conclusions 30

  31. The missing 1% & future work New 100% Semantic analysis @nolint Autofix 31

  32. Conclusions Dmd as a library is usable Public docs Test D-Scanner 32

  33. Conclusions SCA Tools (compilers) are fun D is cool Rebasing is not fun 33

  34. Is it a good idea to share the same codebase with the compiler? 34

Related


More Related Content