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

lispjs

v0.0.4

Published

A small lisp-like language that compiles to JavaScript

Downloads

8

Readme

LispJS

LispJS is a small Lisp-like language that compiles to JavaScript. It is still a work in progress but feel free to take a look at it :).

Installation

You can install LispJS with npm npm install lispjs

To compile a file lispjs source.lispjs -o output.js

The language

The main idea of the language is to have a JavaScript with Lisp syntax. Let's start with a simple example

(alert "Hello World")

As in any lisp the function execution in LispJS is (func param1 param2 ...)

Now there are some specific functions to be used with LispJS such as the def function to define values.

(def a 3)

From that point on the 'a' identifier has the value '3' assigned. One important thing to know is the basic arithmetic functions

(def a (+ 2 2)) (def b (- 4 3)) (def c (* 2 3)) (def d (/ 4 2))

This is equivalent to the JavaScript var a = 2 + 2; var b = 4 - 3; var c = 2 * 3; var d = 4 / 2;

One of the most important things to do with any lisp is working with lists. This is the way to define lists in LispJS

(def xs (list 1 2 3 4))

You can also use the 'car' and 'cdr' functions of lisp

(car xs) ; returns 1 (cdr xs) ; returns (2 3 4)

LispJS also includes some of the traditional lisp operators like map, foldLeft, foldRight and filter. More are to be added in the future.

To define JavaScript objects from LispJS you have to use a list, this way:

(def person (object (list "name" "Eduardo Sorribas" "country" "Dominican Republic")))

As you can see, the language is far from ready and there are many things yet to define. There is an example of LispJS using jQuery in the examples folder. If you have any questions feel free to write to me or create an issue.

Disclaimer

This language was made as a university assignment and was later somewhat fixed. It is obviously missing a lot of stuff: there are not enough tests, the semantic analyzer is incomplete and the language lacks a lot of features. I uploaded on the chance that someone might be interested and would want to check and maybe improve it a bit.

I do not intend this language to be used for professional purposes.. I intend to improve the compiler whenever I have time. If you want to help you can try to write some simple programs and report any issue you had. Or if you want you can try to fix the issue and send a pull request.