GithubHelp home page GithubHelp logo

tubbz-alt / elsa Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elsaland/elsa

0.0 1.0 0.0 5.57 MB

❄️ Elsa is a minimal, fast and secure runtime for JavaScript and TypeScript written in Go

License: MIT License

Go 27.59% Makefile 0.94% TypeScript 71.48%

elsa's Introduction

Elsa

Travis Status Build Status - Badge Discord invite

Elsa is a minimal, fast and secure runtime for JavaScript and TypeScript written in Go, leveraging the power from QuickJS.

Features

  • URL based imports.
  • No fs, net access unless specified.
  • Compliant to web standards.
  • Supports TypeScript.
  • Module caching.
  • Bundle your script into a single file.
  • Create a standalone executable for your bundles.

Install

Not yet released, build from source instead.

Build from source

You will need Go installed on your machine before building.

Install go-bindata using go get github.com/go-bindata/go-bindata/...

Clone the repo on your $GOPATH and run make build to trigger the build process.

Getting Started

Try running a simple program:

// hello.ts
import { hello } from "https://x.nest.land/[email protected]/mod.ts";

hello("Elsa");
> elsa run hello.ts
Hello, Elsa

Contributing

Start by creating an issue about your feature or bug! Then, create a PR and we'll land it 😄

Credits

FAQs

Where to use Elsa and where not to...

Elsa is small and embeddable into Go programs, using Quickjs as the backend comes with certain pros and cons -

PROS:

  • Suitable for CLI applications and shipping them as an executable
  • Native bindings to system level APIs (webview, etc)
  • Hosting discord bots on your raspberry pie 😉
  • Embeddable inside your Go programs.
  • General purpose scripting

CONS:

  • Slower runtime execution than Node and Deno
  • Slower backends
  • Double GC

Why choose QuickJS over V8?

QuickJS is a small and embeddable JavaScript engine but it lacks V8's JIT for fast JavaScript execution. Although, it doesn't mean you cannot use Elsa on backends and CPU intensive tasks.

QuickJS has a better startup time than V8 so it would be a strong alternative for CLI apps and short-lived runs.

Looks like a QuickJS wrapper to me?

Technically, Node and Deno are also V8 wrappers. All do the same job, init engine - init ops - bundle - run. Most people don't realise that implementing native ops is what makes a runtime and not an interpreter.

What's the status of the project?

It is in it's very early stages of development i.e. nothing should be considered stable. Feel free to take it for a spin though :)

What does "minimal" actually refer to?

The goal is to fullfil the bare minimum requirements needed for development of a project. Elsa, although aims to be extendable via plugins. A few examples of features that are not likely to be included in Elsa are tools for formatting, linting and analysis.

In short, develop - package - ship

License

Elsa.land is licensed under MIT License.

elsa's People

Contributors

buttercubz avatar devsnek avatar fsmiamoto avatar github-actions[bot] avatar gsimone avatar layderv avatar littledivy avatar mattn avatar nminhnguyen avatar notfilippo avatar olyno avatar samhza avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.