All Projects → rkoeninger → ShenScript

rkoeninger / ShenScript

Licence: BSD-3-Clause license
Shen for JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to ShenScript

JShellStandalone
Provides a standalone version of the JShell REPL. Anything needed to run JShell independently is contained, so there is no need to install the full JDK. A minimal Java runtime is embedded and compressed using the jlink tool.
Stars: ✭ 36 (-10%)
Mutual labels:  repl
huginn
Programming language with no quirks, so simple every child can master it.
Stars: ✭ 41 (+2.5%)
Mutual labels:  repl
ocamline
👨🏻‍💻 Command line interface for user input
Stars: ✭ 32 (-20%)
Mutual labels:  repl
lambda
lambda calculus interpreter
Stars: ✭ 23 (-42.5%)
Mutual labels:  repl
nodeScratchpad
Evaluate Nodejs Code Snippets From Menubar! 💻
Stars: ✭ 102 (+155%)
Mutual labels:  repl
vue-code-view
A Vue 2 component like Vue SFC REPL `@vue/repl` : u can edit, run and preview the code effect display in real time on the web page.
Stars: ✭ 67 (+67.5%)
Mutual labels:  repl
Restaurant
❤️ A sample Restaurant application based on MVVM (ViewModel, Coroutines, Flow, Repository, Hilt) architecture
Stars: ✭ 24 (-40%)
Mutual labels:  asynchronous-programming
Clojure-Sublimed
Clojure support for Sublime Text 4
Stars: ✭ 268 (+570%)
Mutual labels:  repl
nim-noise
Nim implementation of linenoise command line editor
Stars: ✭ 45 (+12.5%)
Mutual labels:  repl
snap
Snap Programming Language
Stars: ✭ 20 (-50%)
Mutual labels:  asynchronous-programming
ws-repl
MIGRATED TO https://vcs.rowanthorpe.com/rowan/ws-repl - THIS IS AN ARCHIVED VERSION... Arbitrary REPL in a web-page using websocketd
Stars: ✭ 38 (-5%)
Mutual labels:  repl
asyncoro
Python framework for asynchronous, concurrent, distributed, network programming with coroutines
Stars: ✭ 50 (+25%)
Mutual labels:  asynchronous-programming
Replay.jl
Replay your REPL instructions
Stars: ✭ 24 (-40%)
Mutual labels:  repl
replbot
Slack/Discord bot for running interactive REPLs and shells from a chat.
Stars: ✭ 169 (+322.5%)
Mutual labels:  repl
LunarML
A Standard ML compiler that produces Lua/JavaScript
Stars: ✭ 127 (+217.5%)
Mutual labels:  transpiler
NeoConsole
NeoConsole offers a command line (REPL) interface to a Pharo image, as well as other tools.
Stars: ✭ 22 (-45%)
Mutual labels:  repl
habrlang
Step by Step guide how to make your own programming language
Stars: ✭ 20 (-50%)
Mutual labels:  transpiler
go-mlog
Go to Mindustry (MLOG) compiler, runtime and decompiler (WIP)
Stars: ✭ 19 (-52.5%)
Mutual labels:  transpiler
json-sql-builder2
Level Up Your SQL-Queries
Stars: ✭ 59 (+47.5%)
Mutual labels:  transpiler
War3Net
A .NET implementation of Warcraft III related libraries.
Stars: ✭ 76 (+90%)
Mutual labels:  transpiler

Shen Version Build Status Docs Status npm

Shen for JavaScript

An implementation of the Shen Language by Mark Tarver for JavaScript. Full documentation can be viewed at shenscript.readthedocs.io.

Features

  • Allows integration with arbitrary I/O.
  • Async operations are transparent to written Shen code.
  • Easy interop: JS can be called from Shen, Shen can be called from JS.
  • Fairly small production webpack bundle (~370KB uncompressed, ~60KB gzip compressed).
  • Decent web startup time (~50ms in Chromium, ~100ms in Firefox).

Prerequisites

Requires recent version (10+) of Node.js and npm.

Works in most modern browers (Chromium, Firefox, Safari and Edge).

Building and Testing

First, run npm install as you would with any other Node project. Then run the following scripts build and test the project. Steps need to be run in order - steps after fetch-kernel won't work if the kernel hasn't been fetched.

Script Description
test-backend Runs mocha tests for the basic environment and compiler.
fetch-kernel Downloads the kernel sources from shen-sources to kernel/.
render-kernel Translates the kernel sources to JavaScript and stores under kernel/js/.
test-kernel Runs the test suite that comes with the Shen kernel.
test-frontend Runs mocha tests for helper and interop functions.
bundle-dev Applies babel transforms and webpack's into web-deployable bundle.
bundle Builds bundle in production mode.
bundle-min Builds minified production bundle.
bundles Generates all bundles.
lint If you make changes, run lint to check adherence to style and code quality.

Running

Demo Page

Run npm start to start webpack watch or npm run bundle-dev to do a one-time build.

If you open index.html in your browser a basic webpage will load, and when ready, it will display the load time. (The production webpack bundle does not automatically create a Shen environment and does not log anything.) index.html should be viewable without hosting in a web server, but you will not be able to use the load function to load additional Shen code if opened from a relative file:// path. http-server is adequate for hosting in a web server.

If you open the JavaScript console in the developer tools, it is possible to access to the $ global object and execute commands:

$.exec("(+ 1 1)").then(console.log);

Chaining the then call is necessary because exec will return a Promise. For more information refer to the documentation.

REPL

Run npm run repl to run a command-line REPL. It should have the same behavior as the shen-cl REPL. node. functions will be available. Run (node.exit) to exit the REPL.

Neither command-line options nor the launcher kernel extension are implemented. ShenScript is not intended to take the form of a standalone executable.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].