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

firefly-compiler

v0.5.35

Published

Firefly compiler

Downloads

3,105

Readme

Firefly programming language

A straightforward language for full-stack development.

  • Hybrid imperative+functional style with uncomplicated types.
  • Code sharing between the browser and the server.
  • Comprehensive IDE support (MacOS/Windows/Linux).
  • Cross-compilation of executables (MacOS/Windows/Linux).
  • Asynchronous functions without the async/await hassle.
  • Super simple package management with repeatable builds.

This is a preview. Please take it for a ride and tell us what you think!

Writing your first webapp

Install the VSCode extension.

Create a WebApp.ff file.

Type webapp and autocomplete to get a minimalistic client and server (you may need to give the extension a few seconds to initialize first).

Go to the Run and debug side bar and choose create a launch.json file.

Press F5 or click Run. View the running webapp at http://localhost:8080/

In the WebApp.ff file you'll see a nodeMain, which runs on the server, and a browserMain, which runs on the client. There's also a buildMain which is the build step that compiles the client side code to JavaScript so that it can be served to the browser.

Building an executable

Install the firefly compiler:

npm install -g firefly-compiler

Build executables for Linux, MacOS and Windows:

firefly build WebApp.ff

You can find the executables in .firefly/

The command line interface can also run WebApp.ff directly by typing:

firefly WebApp.ff

Connecting to PostgreSQL

To connect to a PostgreSQL database, add this dependency to the top of the file:

dependency ff:postgresql:0.0.0

And import the Pg module from it:

import Pg from ff:postgresql

Create a connection pool with the appropriate connection parameters:

let pool = Pg.makePool(...)

And run your first transaction, e.g.:

pool.transaction {connection =>
    let emails = connection.statement("""
        select email from users
    """).map {row =>
        row.getString("email").grab()
    }
    Log.debug(emails)
}

What's next

For now, you're on your own! Lots of things you'll be missing. We're working on it.

To follow the development or get help, join #firefly on https://discord.gg/FHv8vXJNVf - we're a friendly bunch, and your feedback is appreciated!

This repository contains the source code of the compiler and language server. It's all written in Firefly! Apart from extension.js, the JavaScript files you see in this repository are generated from Firefly code.