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

whip

v0.1.7

Published

The Haskellish LISP dialect.

Downloads

26

Readme

Whip: A Haskellish LISP

Install

Until I post this to the npm registry, you can install whip by doing:

git clone https://github.com/L8D/Whip.git && cd Whip && sudo npm install

Semantics

See goal.md for details on how the language will eventually be. For now, this README will be what I have implemented so far.

; literals
1 ; 1.0
1.1 ; 1.0
"a string" ; "a string"

; lists
(1 2) ; [1, 2]
("foo" 5 "bar")

; lambdas
(lambda (arg1 arg2) (reduce + "part of return value" arg1 arg2))
; syntactic alternative is '->'
((-> (name, item)
  (reduce + (name " hates " item)))
    "Bob" "duct tape") ; "Bob hates duct tape"

; variables
(let ((x 5) (y 10)) (
  (x) ; 5
  (+ x y)) ; 15
x ; undefined error

; standard functions
(+ 36 6) ; 36 + 6 => 42
(- 50 8) ; 50 - 8 => 42
(* 7 6) ; 7 * 6   => 42
(/ 84 2) ; 84 / 2 => 42

; comparatives
(equal 10 10) ; true
(greater 10 5) ; true
(lesser 5 10) ; true
(not (equal 5 10)) ; true
(either (equal 10 10) (equal 5 10)) ; true
(both (equal 10 10) (equal 5 10)) ; false
; syntax alternatives
; =: equal
; >: greater
; <: lesser
; !: not
; ^: either
; &: both
(= 10 10) ; true
(> 10 5) ; true
(< 5 10) ; true
(! (= 5 10)) ; true
(^ (= 10 10) (= 5 10)) ; true
(& (= 10 10) (= 5 10)) ; false

; conditionals
(if true "true was true" "true was false")
; syntactic alternative
(? (= 10 11) "if true" "if false") ; false

; comprehensions
(reduce + (1 2 3))
; same as
(+ (+ 1 2) 3)
(map (lambda (x) (+ x 1)) (1 2 3)) ; [2, 3, 4]

; get value at index of list
(at 1 (1 2)) ; 1
; syntactic alternative
(: 2 (3 4)) ; 4

; append to array
(append 5 (1 2 3 4)) ; [1, 2, 3, 4, 5]
; syntactic alternative
(<< "bar" ("foo")) ; ["foo", "bar"]

; length of an array
(length (1 2)) ; 2
; syntactic alternative
(_ (1 2 3 4 5)) ; 5

; printing...
(print "foo")

; additionally there are a plethora of haskell functions