Here’s a screenshot of #nostrscript which is currently working inside of damus! This script connects to a specific relay (primal) and fetches their trending data using their custom query.

The language im using here is actually AssemblyScript, which compiles to wasm. You can use any programming language in theory to code nostrscripts. Damus executes the wasm binary directly.

These scripts will be the engine of custom list views, allowing a very powerful system for pluggable algorithms. You will also be able to broadcasts these scripts to the network, and damus can automatically list and load them, enabling a marketplace of algorithms.

Reply to this note

Please Login to reply.

Discussion

goddamn 🏌️‍♂️

We talked about this…:

where can I see more of this?

i think this will be huge.

I think so too 🤝

👀 v nice

🔥

I'm kinda concerned running remote downloaded binaries is not gonna fly with AppStore keepers...

Browsers do the same thing.

Apple explicitly allows shipping Javascript OTA updates to web based apps. I think they just don’t want apps to sneak in usage of restricted native features between review cycles.

These scripts are heavily sandboxed and restricted in what they can do, its fine.

“2.5.2 Apps should be self-contained in their bundles, and may not read or write data outside the designated container area, nor may they download, install, or execute code which introduces or changes features or functionality of the app, including other apps. Educational apps designed to teach, develop, or allow students to test executable code may, in limited circumstances, download code provided that such code is not used for other purposes. Such apps must make the source code provided by the app completely viewable and editable by the user.”

4.7 also talks about the exception for JavaScript.

https://developer.apple.com/app-store/review/guidelines/

If it use interpret from apple it will probably be fine.

Is #nostrscripts like a #nostr power shell?

huge 🚀

damnnnnus

Can’t wait✨

Thanks, Will. 🙏🏼

Ur lik a ninja

Now that’s pretty cool!

Nice 👀

Super cool.

One thing to note is that this is not a supported public API. We iterate rapidly with these things (“cache3.primal.net/cache15" 😂), and deprecate obsolete stuff without notice.

If there is interest in using these trending feeds, we can look into standing up something with better guarantees that it will stay up. Would love to see trending posts in Damus and generally happy to do it for all app devs who wish to use these feeds.

Right this is why I’m using it as an example script, i would never add this directly in damus since its a custom api that could break. This script could be updated in realtime via plugin updates.

“Marketplace of algorithms” — what a beautiful concept ⚡️

Code is beautiful. What editor is that?

Its not an editor, its just https://carbon.now.sh

Well looks like it's time for me to try Lua in wasm

NostrOS?

cool story bro