Skip to content

Desktop tool to quickly explore and analyze Swift Intermediate Representation (IR) generated by the LLVM compiler, and also generate assembly code.

License

Notifications You must be signed in to change notification settings

heroesofcode/swift-explorer

Repository files navigation

Swift Explorer

CI codecov GitHub Release macOS Version GitHub

Desktop tool to quickly explore and analyze Swift Intermediate Representation (IR) generated by the LLVM compiler, and also generate assembly code.

Features

  • Deep Code Understanding: Developers can see how Swift code is transformed into both LLVM IR and assembly code, helping them better understand optimization and low-level behavior.
  • Advanced Debugging: Viewing LLVM IR and assembly can help identify performance issues or hard-to-trace bugs in source code.
  • Education and Learning: A valuable educational tool for learning about compilers and how different language constructs translate into intermediate representation and assembly.
  • Optimization: Helps identify and optimize code snippets that are not compiling efficiently by providing insights from both LLVM IR and assembly.
  • Comparative Analysis: Allows you to compare how different approaches or code versions generate different IR and assembly code, facilitating the choice of best coding practices.
  • IA Gemini: You can see how to improve your code and compare LVVM and Assembly with the help of Gemini.

Important

To review the details through Gemini, you must generate an API Key through this link.

Optimization flags

  • Onone: Compile without any optimization.
  • Osize: Compile with optimizations and target small code size.
  • Ounchecked: Compile with optimizations and remove runtime safety checks.
  • O: Compile with optimizations.

Installing

Download the dmg - click here

Contributing

Please see the documentation

Run the project

Install mise

mise install

Generate SwiftExplorer.xcworkspace with Tuist

tuist install
tuist generate

Inspiration

This project was inspired by kotlin-explorer developed by Romain Guy.

If you have any questions about the kotlin-explorer tool, I recommend you watch the talk Practical Optimizations - Romain Guy

License

swift-explorer is released under the MIT license. See LICENSE for details.

About

Desktop tool to quickly explore and analyze Swift Intermediate Representation (IR) generated by the LLVM compiler, and also generate assembly code.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •