Skip to content

maxBRT/pithon

 
 

Repository files navigation

Pithon - Academic Python Interpreter

Python License

Pithon is a Python interpreter designed in an academic context to understand the internal mechanisms of programming languages. A comprehensive learning experience to explore language theory and interpreter implementation.

Educational Objectives

This academic project aims to:

Theoretical Learning

  • Understand fundamental concepts of language theory
  • Explore compilation phases: lexing, parsing, evaluation
  • Master abstract syntax trees (AST) and their manipulation

Practical Experimentation

  • Implement a complete interpreter from scratch
  • Test different evaluation strategies
  • Compare with the official Python interpreter

Implemented Features

Core Concepts

  • Data types: Numbers, booleans, strings, lists, tuples, None
  • Control structures: if/else, while, for, break, continue
  • Functions: Definition, calling, variable arguments, recursion
  • Classes and objects: Complete object-oriented programming
  • Operators: Arithmetic, logical, comparison, membership

Exploration Tools

  • Interactive CLI: Interface for testing and experimenting
  • AST mode: Abstract syntax tree visualization
  • Automated tests: Complete test suite with 50+ use cases
  • Error handling: Educational and informative error messages

Quick Installation

Prerequisites

  • Python 3.10 or higher
  • uv package manager (recommended)

Installation

# Clone the repository
git clone https://github.com/maxBRT/pithon.git
cd pithon

# Install with uv (recommended)
uv sync

Experimentation and Learning

Interactive Interface

# Launch the interpreter to experiment
uv run pithon

# AST mode to understand syntactic structure
uv run pithon --ast

File Execution

# Execute a Python program to see the interpreter in action
uv run pithon my_program.py

# Visualize the AST to understand parsing
uv run pithon --ast my_program.py

Testing and Validation

# Run the test suite to verify concepts
uv run pytest

License

This project is licensed under the MIT License. See the LICENSE.md file for more details.

🙏 Acknowledgments

  • Vincent Archambault (@archambaultv-prof) - For his guidance, valuable advice, and support throughout this project.

Pithon - Interpréteur Python Académique

Python License

Pithon est un interpréteur Python conçu dans un cadre académique pour comprendre les mécanismes internes des langages de programmation. Une expérience d'apprentissage complète pour explorer la théorie des langages et l'implémentation d'interpréteurs.

Objectifs Pédagogiques

Ce projet académique vise à :

Apprentissage Théorique

  • Comprendre les concepts fondamentaux de la théorie des langages
  • Explorer les phases de compilation : lexing, parsing, évaluation
  • Maîtriser les arbres syntaxiques abstraits (AST) et leur manipulation

Expérimentation Pratique

  • Implémenter un interpréteur complet de A à Z
  • Tester différentes stratégies d'évaluation
  • Comparer avec l'interpréteur Python officiel

Fonctionnalités Implémentées

Concepts Fondamentaux

  • Types de données : Nombres, booléens, chaînes, listes, tuples, None
  • Structures de contrôle : if/else, while, for, break, continue
  • Fonctions : Définition, appel, arguments variables, récursion
  • Classes et objets : Programmation orientée objet complète
  • Opérateurs : Arithmétiques, logiques, de comparaison, d'appartenance

Outils d'Exploration

  • CLI interactif : Interface pour tester et expérimenter
  • Mode AST : Visualisation de l'arbre syntaxique abstrait
  • Tests automatisés : Suite de tests complète avec 50+ cas d'usage
  • Gestion d'erreurs : Messages d'erreur éducatifs et informatifs

Installation Rapide

Prérequis

  • Python 3.10 ou supérieur
  • Gestionnaire de paquets uv (recommandé)

Installation

# Cloner le repository
git clone https://github.com/maxBRT/pithon.git
cd pithon

# Installer avec uv (recommandé)
uv sync

Expérimentation et Apprentissage

Interface Interactive

# Lancer l'interpréteur pour expérimenter
uv run pithon

# Mode AST pour comprendre la structure syntaxique
uv run pithon --ast

Exécution de Fichiers

# Exécuter un programme Python pour voir l'interpréteur en action
uv run pithon mon_programme.py

# Visualiser l'AST pour comprendre le parsing
uv run pithon --ast mon_programme.py

Tests et Validation

# Lancer la suite de tests pour vérifier les concepts
uv run pytest

Licence

Ce projet est sous licence MIT. Voir le fichier LICENSE.md pour plus de détails.

🙏 Remerciements

  • Vincent Archambault (@archambaultv-prof) - Pour son encadrement, ses conseils avisés et son soutien tout au long de ce projet.

About

Interpréteur simple pour Python

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%