Something went wrong. Try again.
An interpreted programming language designed for embedding.
Something went wrong. Try again.
Files
- C 96%
- Shell 4%
- Lua <1%
- Python <1%
readme
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);
}
}
install
-------
Dependencies: sh, a c99 compiler, git
git clone https://tangled.org/emmeline.girlkisser.top/puppy
cd puppy
sh run.sh "build/standalone release" install/by-cp
# puppy's executable will be copied to ~/.local/bin/puppy.
You can also use `install/by-ln` to install via a symlink
instead, if you prefer.
To install development headers and the shared library:
sh run.sh "build/shared release" install/headers install/shared
To perform a full system-wide install (i.e, headers, shared
library, and executable):
sh run.sh "build/standalone release" "build/shared release"
# Make sure to delete previously installed headers as the
# script does not do this automatically:
sudo rm -rf /usr/local/include/puppy/
sudo sh run.sh install/headers install/shared "install/by-cp /usr/local/bin/"
editor support
--------------
VSCode, VSCodium: pup-vscode <https://tangled.org/emmeline.girlkisser.top/pup-vscode>
Zed, Gram: pup-zed <https://tangled.org/emmeline.girlkisser.top/pup-zed>
Helix: planned
(not an editor but /shrug)
Tree-Sitter: puppy-tree-sitter <https://tangled.org/emmeline.girlkisser.top/puppy-tree-sitter>
develop
-------
See <docs/devs.md>.
todo
----
x Improve syntax+thrown errors and completely change how
errors are handled in the C API. exit() should be seldom
used.
x Document API and clean up source
. Maybe I could use arena allocations where possible to try
and keep memory closer together?
x String interning
. Update _strfind to use a more optimal implementation.
. Create a document in <doc/> regarding doc-comments.
. Replace single-pass interpreter with a bytecode VM? First
I need to measure if I can improve the performance of the
single-pass interpreter. If I can get it to a point that's
at least competitive with other interpreters, then I'm fine
leaving Puppy as single-pass.