Funky Language Implementation - #5
Conversation
- Created Peggy grammar for Funky lang in src/funky.pegjs. - Implemented AST to TypeScript transpiler in src/transpiler.ts. - Created a runner in src/index.ts to transpile and execute Funky code. - Added example Funky programs in examples/ directory. - Configured project with tsconfig.json and .gitignore. Steps taken: 1. Explored requirements and set up the environment with peggy and ts-node. 2. Drafted the grammar based on the provided BNF, adding whitespace and currying support. 3. Implemented the transpiler, mapping Funky's unique constructs (do-where blocks, algebraic data types, protocols) to TypeScript. 4. Verified the implementation with minimal and complex examples. Challenges: The grammar for function definitions was sensitive to whitespace and the distinction between parameter lists and return types. I spent time refining the PEG rules to correctly distinguish between curried function signatures and complex types. Co-authored-by: sonneko <152277125+sonneko@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR implements the Funky language by providing a Peggy-based parser and a TypeScript transpiler. It allows Funky programs to be executed by converting them to TypeScript and running them via ts-node. Key features implemented include curried functions, structural types, algebraic data types (enums), protocols, and do-where blocks.
Fixes #4
PR created automatically by Jules for task 11252812730886808648 started by @sonneko