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

@pivot-lang/pivot-lang

v0.1.2-7afd45c.0

Published

[![codecov](https://codecov.io/gh/Pivot-Studio/pivot-lang/branch/master/graph/badge.svg?token=CA17PWK0EG)](https://codecov.io/gh/Pivot-Studio/pivot-lang) [![release](https://github.com/Pivot-Studio/pivot-lang/actions/workflows/release.yml/badge.svg)](http

Downloads

392

Readme

Pivot Lang

codecov release test

codecov

此项目目前处于早期开发阶段,不建议用于生产环境。
项目地址

安装

此处

官网

https://pivotlang.tech

CONTRIBUTING

CONTRIBUTING贡献代码

欢迎加入: QQ群 discord

dependencies

重要:如果你想参与开发,请先在项目目录make vm install,然后根据自己是linux还是mac运行make devlinux或者make devmac

特点

  • 支持静态编译与JIT
  • REPL
  • 热重载
  • 极其方便的Rust互操作
  • 支持debug
  • 支持lsp,自带vsc插件,能提供优秀的代码支持
  • 有GC,自动管理内存
  • 强大的类型推断,支持省略大部分类型标注

一些ShowCases

Ray Tracing in One Weekend in Pivot Lang

使用Pivot Lang实现的简单光追

example

编辑器支持

debug

lsp

Hello World

fn main() i64 {
    println!("hello world!");
    return 0;
}

HashTable

(没错,我们的哈希表源码也是完全用Pivot Lang写的)

use std::cols::hashtable;
use core::panic::assert;
use core::eq::*;

fn main() i64 {
    let table = hashtable::new_hash_table(10 as u64, 1 as u64);
    table.insert("hello","world");
    table.insert("bye","bye");
    assert(table.get("hello") is string);
    let v = table.get("hello") as string!;
    assert("world".eq(&v));
    return 0;
}

Fibonacci

use std::io;
fn main() i64 {
    let result = fib(10);
    println!(result);
    return 0;
}

fn fib(n: i64) i64 {
    let pre = 0;
    let nxt = 0;
    let result = 1;
    for let i = 0; i < n; i = i + 1 {
        result = result + pre;
        pre = nxt;
        nxt = result;
    }
    return result;
}

Y组合子

use core::panic;
pub fn main() i64 {
    let g = |f, x| => {
        if x == 0 {
            return 1;
        }
        return x * f(x - 1);
    };
    let fact = Y(g);
    for let x = 0; x < 10; x = x + 1 {
        panic::assert(fact(x) == fact_recursion(x));
    }
    return 0;
}


struct Func<A|F> {
    f: |Func<A|F>, A| => F;
}

impl<A|F> Func<A|F> {
    fn call(f: Func<A|F>, x: A) F {
        return self.f(f, x);
    }

}

fn Y<A|R>(g: ||A| => R, A| => R) |A| => R {
    // 下方代码的类型推断是一个很好的例子
    return |x| => {
        return |f, x| => {
            return f.call(f, x);
        }(Func{
            f: |f, x| => {
                return g(|x| => {
                    return f.call(f, x);
                }, x);
            }
        }, x);
    };
}

fn fact_recursion(x: i64) i64 {
    if x == 0 {
        return 1;
    }
    return x * fact_recursion(x - 1);
}