No description
Find a file
2026-02-12 00:27:50 -06:00
benchmark Add lambdas, string escapes, filename in errors, and clock() function. Change framegetvar to not use recursion. 2026-02-08 10:40:10 -06:00
doc Add if/let 2026-02-11 14:43:59 -06:00
include Add find and substr to strings module 2026-02-12 00:27:50 -06:00
sample Add find and substr to strings module 2026-02-12 00:27:50 -06:00
scripts Clean up stdlib source and add stdfs 2026-02-11 20:00:13 -06:00
src Add find and substr to strings module 2026-02-12 00:27:50 -06:00
std Add find and substr to strings module 2026-02-12 00:27:50 -06:00
test Add expression-based for loops, binary literals, and hexadecimal literals. Fix underscore parsing in numbers. 2026-02-11 13:40:27 -06:00
.gitattributes Fix comment lexing. Add guide.md and .gitattributes 2026-02-06 12:33:24 -06:00
.gitignore Clean up stdlib source and add stdfs 2026-02-11 20:00:13 -06:00
readme Separate pup_val and pup_obj type enum 2026-02-08 16:47:42 -06:00
run.sh Vastly improve error handling. Optional semis for functions with a block expression. Update stdlib a little bit. 2026-02-04 18:22:03 -06:00

puppy
=====

A minimalistic scripting language for embedding.

  greet(whom: str) =
    print("Hello, ", whom.name, "!");

  main = {
    let names = ["Gandalf", "Bilbo", "Frodo"];
    for name in names {
      greet(name);
    }
  }

todo
----

. Change VM/framestacks to hold variables in a single hash
table instead of many small hash tables. In theory, this
should provide a substantial performance improvement to
variable lookups.
x Improve syntax+thrown errors and completely change how
errors are handled in the C API. exit() should be seldom
used.
. Document API and clean up source
. Optimise memory layout to keep memory more contiguous.
I'm thinking that I could allocate a large arena at the
start of the program and allocate anything that'll stick
around inside that. Dynamic objects like the stack might be
more tedious since they're likely to move around in memory
as the program runs for longer periods of time. Maybe I
could make the "main" part of the stack live in the arena
and then separate out the "extra" (less commonly accessed)
part elsewhere in memory as needed. Basically a "chunked
dynamic list" of some kind. Resizing hash tables would be
more tedious, but I'm sure there's an optimization I could
implement.