GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — VibesProgrammingLanguage/vibes-compiler.py at main · tomopas/VibesProgrammingLanguage Expand file tree/ Copy pathvibes-compiler.pyMore file actions 71 lines (50 loc) · 1.53 KB / Copy pathvibes-compiler.pyFile metadata and controls71 lines (50 loc) · 1.53 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 import subprocess import sys import os from pathlib import Path from google import genai KEY_FILE = Path.home() / ".vibes_api_key" def load_api_key(): if KEY_FILE.exists(): key = KEY_FILE.read_text().strip() if key: return key print("[VIBES] No API key found.") key = input("Enter your Gemini API key: ").strip() if not key: print("[VIBES] Error: No key entered.") sys.exit(1) KEY_FILE.write_text(key) print(f"[VIBES] API key saved to {KEY_FILE}") return key def compile_vibes(source_path): api_key = load_api_key() client = genai.Client(api_key=api_key) with open(source_path, "r", encoding="utf-8") as f: vibes_code = f.read() prompt = f""" You are the compiler for the Vibes Programming Language (VPL). Convert the following Vibes code into valid Python code. Only output Python code, no explanations. Vibes code: {vibes_code} """ response = client.models.generate_content( model="gemini-2.0-flash", contents=prompt ) generated_code = response.text out_file = "out.py" with open(out_file, "w", encoding="utf-8") as f: f.write(generated_code) print(f"[VIBES] Code generated → {out_file}") return out_file def run_compiled(path): subprocess.run(["python", path]) if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: vibes-compiler.py <file.vibe>") sys.exit(1) src = sys.argv[1] out = compile_vibes(src) run_compiled(out) |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |