You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* for starlet new v010
* less dep
* update go sum
* simple
* save mod names
* fast convert
* __mod tests
* refine load mod tetss
* add summary
* more testings
* for complex testing
* for getter modules
* no modules
* update readme
Starlark in a box -- a simple Starlark REPL and script runner.
9
+
*Starbox* is a pragmatic Go wrapper around the [*Starlark in Go*](https://github.com/google/starlark-go) project, making it easier to execute Starlark scripts, exchange data between Go and Starlark, and call functions across the Go-Starlark boundary. With a focus on simplicity and usability, *Starbox* aims to provide an enhanced experience for developers integrating Starlark scripting into their Go applications.
10
10
11
-
It provides three main features:
11
+
## 🚀 Key Features
12
12
13
-
-**Execute** a Starlark script file or REPL
14
-
-**Data** exchange between Starlark and Go
15
-
-**Function** call from Starlark to Go, or vice versa
13
+
A host of powerful features are provided to supercharge your Starlark scripting experience:
14
+
15
+
-**Streamlined Script Execution**: Simplifies setting up and running Starlark scripts, offering a seamless interface for both script execution and interactive REPL sessions.
16
+
-**Efficient Data Interchange**: Enables robust and smooth data exchange between Go and Starlark, enhancing the interoperability and simplifying the integration process.
17
+
-**Versatile Module Management**: Extends Starlark's capabilities with a suite of built-in functions and the ability to load custom and override existing modules, covering functionalities from data processing to HTTP handling and file manipulation.
18
+
-**Cross-Language Function Calls:** Leverage the power of both languages by calling Go functions from Starlark and vice versa, creating powerful integrations.
19
+
-**Integrated HTTP Context**: Facilitates handling HTTP requests and responses within Starlark scripts, catering to web application development and server-side scripting.
20
+
-**Collective Memory Sharing**: Introduces a shared memory concept, enabling data sharing across different script executions and instances, fostering a more connected and dynamic scripting environment.
21
+
-**Advanced Scripting Tools:** Utilize features like REPL for interactive exploration and debugging, along with script caching for improved performance.
22
+
23
+
## 📦 Installation
24
+
25
+
To include `starbox` in your Go project, use the following command:
26
+
27
+
```bash
28
+
go get github.com/1set/starbox
29
+
```
30
+
31
+
## ⚙️ Usage
32
+
33
+
Here's a quick example of how you can use Starbox:
34
+
35
+
```go
36
+
import"github.com/1set/starbox"
37
+
38
+
// Define your box with global variables and modules
We welcome contributions to the *Starbox* project. If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request. Before undertaking any significant changes, please let us know by filing an issue or claiming an existing one to ensure there is no duplication of effort.
73
+
74
+
## 📜 License
75
+
76
+
*Starbox* is licensed under the [MIT License](LICENSE).
77
+
78
+
## 🙌 Credits
79
+
80
+
This project is inspired by and builds upon several open-source projects:
81
+
82
+
-[Starlark in Go](https://github.com/google/starlark-go): The official Starlark interpreter in Go, created by Google.
83
+
-[Starlight](https://github.com/starlight-go/starlight): A well-known Go wrapper and data conversion tool between Go and Starlark.
84
+
-[Starlight Enhanced](https://github.com/1set/starlight): A sophisticated fork of the original Starlight, with bug fixes and enhancement features.
85
+
-[Starlib](https://github.com/qri-io/starlib): A collection of third-party libraries for Starlark.
86
+
-[Starlet](https://github.com/1set/starlet): A Go wrapper that simplifies usage, offers data conversion, libraries and extensions for Starlark.
87
+
88
+
We thank the authors and contributors of these projects for their excellent works 🎉
// AddModuleScript creates a module with given module script in virtual filesystem, and adds it to the preload and lazyload registry.
318
329
// The given module script can be accessed in script via load("module_name", "key1") or load("module_name.star", "key1") if module name has no ".star" suffix.
330
+
// All the module scripts added by this method would be overridden by SetFS() if it's not nil.
0 commit comments