mirror of
git://jb55.com/damus
synced 2024-10-01 17:30:44 +00:00
97f10e865f
NostrScript is a WebAssembly implementation that interacts with Damus. It enables dynamic scripting that can be used to power custom list views, enabling pluggable algorithms. The web has JavaScript, Damus has NostrScript. NostrScripts can be written in any language that compiles to WASM. This commit adds a WASM interpreter I've written as a mostly-single C file for portability and embeddability. In the future we could JIT-compile these for optimal performance if NostrScripts get large and complicated. For now an interpreter is simple enough for algorithm list view plugins. Changelog-Added: Add initial NostrScript implementation Signed-off-by: William Casarin <jb55@jb55.com>
16 lines
256 B
C
16 lines
256 B
C
|
|
#ifndef PROTOVERSE_DEBUG_H
|
|
#define PROTOVERSE_DEBUG_H
|
|
|
|
#include <stdio.h>
|
|
|
|
#define unusual(...) fprintf(stderr, "UNUSUAL: " __VA_ARGS__)
|
|
|
|
#ifdef DEBUG
|
|
#define debug(...) printf(__VA_ARGS__)
|
|
#else
|
|
#define debug(...)
|
|
#endif
|
|
|
|
#endif /* PROTOVERSE_DEBUG_H */
|