๐ณ Fortran AST/ASR JSON Visualizer
May 26, 2025 ยท View on GitHub
An interactive web-based visualization tool for exploring and understanding Fortran Abstract Syntax Trees (AST) and Abstract Semantic Representation (ASR). This project brings modern web technologies to Fortran development, making it easier to understand and debug Fortran code structure.
This uses LFortran for generating the AST and ASR Json from fortran code.
โจ Features
- ๐จ Interactive Visualization: Dynamic, zoomable tree visualization of AST/ASR structures
- ๐ Real-time Updates: Instantly see changes as you modify JSON input
- ๐ WebAssembly Integration: Powered by LFortran's WASM compilation
- ๐ฏ User-friendly Interface: Clean, modern UI with dark mode support
- ๐ฑ Responsive Design: Works seamlessly on desktop and mobile devices
๐ Live Demo
Try it now: https://ubaidsk.github.io/fortran_ast_asr_json_visualizer/
๐ ๏ธ Setup & Installation
Prerequisites
This setups up node on your local system. Follow this if you don't have node already installed.
-
Install NVM (Node Version Manager)
# For macOS and Linux curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash # Add to your ~/.zshrc export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" -
Install Node.js
nvm install 16 nvm use 16 -
Verify Installation
node --version npm --version
Project Setup
-
Clone the repository
git clone https://github.com/ubaidsk/fortran_ast_asr_json_visualizer.git cd fortran_ast_asr_json_visualizer -
Install dependencies
npm install -
Start development server
npm start -
Build for production
npm run build npm run deploy
๐ง Technical Stack
Core Technologies
- React 18: Modern UI development with hooks and functional components
- WebAssembly: LFortran compilation for AST/ASR processing
- TailwindCSS: Utility-first CSS framework
- DaisyUI: Tailwind CSS component library
Visualization
- React Flow: Interactive node-based visualization
- Dagre: Graph layout and positioning algorithm
- Remix Icons: Modern icon library
Development Tools
- PostCSS: CSS processing and optimization
- Create React App: React application bootstrapping
- GitHub Pages: Deployment and hosting
๐ค Contributing
We welcome all contributions, big or small!
๐ Bug/Feature Request
For reporting bugs or suggestions, please open an issue in the GitHub repository.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ for the Fortran Community