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

skiff-lang

v0.4.5

Published

An immutability-first, functional scripting language with a friendly syntax and compiler/interpreter written in Rust!

Downloads

17

Readme

Skiff

A gradually-typed, functional scripting language with a friendly syntax and interpreter written in Rust!

Running

You can run Skiff in the Skiff web editor (powered by WASM!).

If you prefer to use your own text editor, you can install Skiff from crates.io and run it from the command line

cargo install skiff
skiff <filename> # make sure installed crate binaries are in your PATH

About

Skiff started as a personal project for me to learn more about the design and implementation of programming languages. It was a mash-up of ideas and syntaxes from existing languages. As it evolved, however, it became a platform for me to learn about different algorithms like HM type inference and exhaustiveness checking of pattern match expressions.

Next on the road map is an exploration of gradual typing by adding a typed keyword to distinguish fully type functions from partially typed functions. By default, Skiff will have very few static guarantees. However, you can opt into more checks within a given function by fully annotating the arguments and return type or using the typed keyword to tell Skiff to infer a function type. The goal is to have a language that is as easy to use as a dynamically-typed language while offering some of the guarantees and in-code documentation of statically-typed languages.

What does it look like?

Function definition (types are optional):

def fact(n: Number) -> Number:
    match n:
        | 1 => 1
        | n =>
            let next = fact(n - 1)
            next * n
    end
end

Conditionals:

let cond: Boolean = true
if cond:
    1
elif false:
    2
else:
    3
end

Algebraic datatypes (types are optional):

data Option:
    | some(v: Number)
    | empty()
end

Pattern matching:

match some(1):
    | some(n) => n
    | empty() => 0
end

Anonymous functions:

let increment: Number -> Number = lambda(n): n + 1 end
let add: (Number, Number) -> Number = lambda(a,b): a + b end

Language Reference

Full docs are a work in progress. To get an idea of what the features and syntax look like, you can look at the language tour test file.

Developing

Clone the repo to work on Skiff. You can run a local development version using

cargo run -- <filename>

For example:

cargo run -- tests/files/success/plus_and_times_precedence.boat

Features

Language Features:

| | Tree Walk Interpreter | Bytecode Interpreter | | ------------------------ | --------------------- | -------------------- | | Arithmetic | ✓ | | | Equality Operators | ✓ | | | Conditionals | ✓ | | | Functions | ✓ | | | Recursion | ✓ | | | Lambdas | ✓ | | | Let binding | ✓ | | | Improved Error Reporting | ✓ | | | Type Annotations | ✓ | | | Type Inference | ✓ | | | Algebraic Datatypes | ✓ | | | Pattern Matching | ✓ | | | Exhaustiveness Checking | ✓ | | | Call Stack Traces | ✓ | | | Parameterized Types | | | | typed keyword | | | | Strings | | | | File Operations | | | | Testing Constructs | | |

Miscellaneous:

  • [ ] REPL
  • [ ] Language Reference
  • [x] Web Editor (WASM)
  • [x] Continuous Integration
  • [x] Publish crate