Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
]
}
]
}
46 changes: 46 additions & 0 deletions COMMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Collected comments from `src/splice.h`

This file lists the comments that were present in `src/splice.h` before removal, along with their approximate line numbers (based on the header at the time of extraction). The header was stripped of comments to reduce size for embedded builds; this file preserves the removed comments for reference.

Comments in `src/splice.h` (by approximate line number):

- Line 3: `/* Splice runtime header */`
- Line 67: `/* Diagnostics */`
- Line 90: `/* Values / Objects */`
- Line 113: `/* SDK include */`
- Line 116: `/* AST */`
- Line 157: `/* "+", "-", "*", "/", "==", "&&", "!" ... */` (inline on `char *op`)
- Line 159: `/* may be NULL for unary */` (inline on `ASTNode *right`)
- Line 185: `/* may be NULL */` (inline on `else_branch`)
- Line 238: `/* Env (vars + funcs) */`
- Line 251: `/* power of 2 = fast modulo */` (inline on `#define VAR_TABLE_SIZE`)
- Line 254: `/* interned or strdup */` (inline on `char *name`)
- Line 292: `/* empty slot = not found */` (inline on `return NULL`)
- Line 297: `/* linear probe */` (inline on `idx = (idx + 1) & ...`)
- Line 370: `/* Forward declarations */`
- Line 455: `/* AST alloc/free */`
- Line 465: `/* AST serialization helpers */`
- Line 481: `/* !SPLICE_EMBED */` (in `#endif /* !SPLICE_EMBED */`)
- Line 587: `/* =========================\n Runtime eval/interpret\n ========================= */` (decorative)
- Line 864: `/* string concat on + */`
- Line 939: `/* ---------------- recursion safety ---------------- */`
- Line 945: `/* ============================================================\n NATIVE C FUNCTIONS\n ============================================================ */`
- Line 967: `/* ============================================================\n USER-DEFINED FUNCTION\n ============================================================ */`
- Line 975: `/* ============================================================\n SAVE OLD PARAM VALUES (GLOBAL TABLE HACK)\n ============================================================ */`
- Line 987: `/* shallow copy is enough */` (inline on `saved[i] = *v;`)
- Line 994: `/* ============================================================\n BIND PARAMETERS\n ============================================================ */`
- Line 1017: `/* ============================================================` (decorative)
- Line 1027: `/* normal execution */`
- Line 1029: `/* no return → default 0 */`
- Line 1031: `/* returned via AST_RETURN */`
- Line 1037: `/* ============================================================` (decorative)
- Line 1048: `/* param did not exist before → reset to 0 */`
- Line 1081: `/* take ownership of string returned by eval */`
- Line 1327: `/* =========================` (decorative)
- Line 1337: `/* Splice_H */` (in `#endif /* Splice_H */`)

Notes:
- Many comments were decorative section dividers or short inline hints. All have been removed from `src/splice.h` to reduce header size for embedded builds.
- If you want to retain a subset, I can reintroduce selected comments behind `#if !SPLICE_EMBED` so they remain only in desktop builds.

If you want an exact before/after diff with line numbers, I can produce that next.
37 changes: 34 additions & 3 deletions Docs/doc/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ This design allows:

---

## Embedding Splice in C
## SpliceCSDK

### Embedding Splice in C

Splice is designed to be embedded in C applications.

Expand Down Expand Up @@ -261,9 +263,38 @@ void loop() {}

```

---
### Splice functions

Splice has functions that let you configure the VM. These Function are great to configure the VM for specfic tasks.

#### ``splice_set_call_depth``

This function is designed to set a recursion max depth. This is great for limiting how many times a function can recurse. Below is an example of showing this happening.

``` C
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "splice.h"
// This code will tell splice that after 100 recursions to stop.
splice_set_call_depth(100);
ASTNode *root = read_ast_from_spc(arg);
interpret(root);
free_ast(root);
```

#### ``splice_disable_tick_limit``
This function is designed to disable Splice's default **Tick Limit** (Currently set to ``1000000``)
This function works cleanly with the [``splice_set_tick``](#splice_set_tick)

#### ``splice_set_tick``


> This function **will only** work when ``splice_disable_tick_limit`` is in the script

This function is desinged to set how many instructions will run before exiting

---

© Copyright 2026 OpenSplice and the Sinha Group
Licensed under the MIT License
Licensed under the MIT License
Binary file modified bin/Splice
Binary file not shown.
Binary file modified bin/spbuild
Binary file not shown.
Binary file added examples/array/array.spc
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/array/array.spl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let nums = [1,2,3];
nums = [1,2,3];
print(len(nums));
append(nums, 42);
print(len(nums));
Expand Down
Binary file modified examples/calculator/hello.spc
Binary file not shown.
Binary file modified examples/forloops/for.spc
Binary file not shown.
Binary file removed recurse.spc
Binary file not shown.
9 changes: 0 additions & 9 deletions recurse.spl

This file was deleted.

Binary file added src/.DS_Store
Binary file not shown.
Loading