God, Love, News, Event, Entertainment, Amebo,..... All about Bringing out the best in you...
Show HN: I built a minimal Forth-like stack interpreter library in C https://ift.tt/VqOidM4
Show HN: I built a minimal Forth-like stack interpreter library in C This weekend I created stacklib.h - a single-header library that brings Forth-style stack operations to C. It implements a basic interpreter with: - Stack operations (push/pop/dup/swap/over/drop) - Arithmetic (+, -, *, /) - Output (., emit, cr) - Stack inspection (.s, depth) Example usage: Stack s; stack_init(&s); dict_init(); exec(&s, "10 20 + ."); // Prints "30" exec(&s, "1 2 3 4 .s"); // Shows stack contents The library is self-contained, requires no dependencies, and handles basic error checking. It was inspired by wanting to understand how Forth works at a fundamental level while keeping the simplicity of C. I'm curious what other stack-based or concatenative programming enthusiasts think about this approach. Has anyone else built something similar? What features would you add to make it more useful? GitHub: https://ift.tt/JxfgNSV September 11, 2025 at 02:15AM
Subscribe to:
Post Comments (Atom)
Show HN: Claudoro, Pomodoro timer embedded in the Claude Code statusline https://ift.tt/Kp5WXI1
Show HN: Claudoro, Pomodoro timer embedded in the Claude Code statusline 3 weeks ago I had a nasty accident and fractured my vertebrae. As I...
-
submitted by /u/Dull_Tonight [link] [comments] source https://www.reddit.com/r/worldnews/comments/pehy48/housing_secretary_robert_je...
-
Show HN: Lindra – generate browser agents to automate any website Hi HN, We’re one month into building Lindra, a platform that turns any web...
-
Show HN: High-precision date/time in SQLite https://ift.tt/hEvedVC August 12, 2024 at 03:47AM
No comments:
Post a Comment