npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@aroobaito/biwa-shamisen

v0.1.0

Published

A BiwaScheme websocket server that provides support for interactive programming and integration with Emacs

Downloads

7

Readme

Shamisen

Shamisen is a BiwaScheme websocket server that provides support for interactive programming and integration with Emacs, or in other words SLIME integration for BiwaScheme, the Scheme implementation by Yutaka Hara written on top of Javascript/NodeJS. Specifically, this integration is for a live connection to the browser, as the Node version of BiwaScheme can already be accessed using inferior Scheme in Emacs by connecting it to the "biwas" command in the same way Gauche, Gambit, and other Scheme implementations do.

Using Shamisen, you can select any Scheme code in Emacs and have it execute in real-time in the web browser.

Usage example

Here is a demonstration of a webGL game coded in BiwaScheme on top of PlayCanvas with code being able to be re-written and executed as the game is running:

https://cdn.discordapp.com/attachments/864562446714535978/872241082635780116/shamisen_example.gif

Installation

The easiest way to install Shamisen is by typing "npm install -g biwa-shamisen" in a console/terminal. Alternatively, you can download the files here, extract them to a directory, and then run "npm install -g ." from within the directory.

Here are the steps necessary for setup:

Emacs setup (do this once)

Once Shamisen has been installed using the npm command above, open Emacs, press ctrl + X, ctrl + F, then open "~/.emacs". At the bottom, type: (setq scheme-program-name "shamisen-emacs") to set Shamisen/BiwaScheme as your default Emacs inferior Scheme. Then restart Emacs.

Per project instructions

First, start the Shamisen server by typing "shamisen" in a command prompt/terminal. Immediately following installation, it might take a minute for the Shamisen server to start as it caches for first-time use, but the following runs will be instantaneous. When successful, it will say "Shamisen started on port 8090". At the moment this port is hard-coded since I haven't bothered to figure out how to feed custom ports from an Emacs inferior Scheme. If you're familiar with that process, feel free to uncomment the lines in the client and the server pertaining to reading the port from the command-line, otherwise I will likely update it with this feature in the future.

Next, install the Shamisen browser client to your project. If you installed Shamisen off of NPM on Windows, the SCM will be in

C:/users/(your login)/AppData/Roaming/npm/node_modules/biwa-shamisen/bin/Scheme/shamisen-browser.scm

Alternatively you can do a second local npm install of Shamisen and grab the file from there or grab it from this repository. Place the shamisen-browser.scm next to your index.html and edit the index.html as shown:

image

The important scripts here are "biwascheme.js" in the header of course, and the section, which loads my game logic from "core.scm" and you can safely ignore, but also it loads "shamisen-browser.scm" which will connect to the Shamisen server that is now running. You can now host the index.html file however you usually do so with an express JS server, a Gauche Makiki server, Python + Flask, etc.

When you open the link to your hosted HTML file you will see "Connected to Shamisen server successfully" in the JavaScript console and "Connected to browser successfully" in the Shamisen server console. Now you can open any .scm in Emacs, press ctrl + X, 2 to split the screen into 2 windows, and then run the inferior Scheme from the Scheme menu at the top as shown:

image

"Emacs connected successfully" will appear in the Emacs Scheme prompt as well as in the Shamisen server console. You can now place the cursor at the end of any S-expression and press CTRL + X, CTRL + E to execute it in the browser just as you would with any other SLIME implementation.

If you have any questions, feel free to e-mail me at [email protected] or contact me on Twitter @ArooBaitoArt.