Skip to content

Commit

Permalink
Release v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
samestep committed Sep 18, 2023
1 parent 7bf3990 commit d34184f
Show file tree
Hide file tree
Showing 18 changed files with 106 additions and 1,294 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release
on:
release:
types:
- created

jobs:
publish:
runs-on: ubuntu-22.04
steps:
- name: Clone repo
uses: actions/checkout@v3
- run: make all
- name: Publish npm packages
run: npm publish --workspaces
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
.DS_Store
*.tgz
*.vsix
/.cargo/
/packages/vscode/*.png
/packages/core/README.md
/packages/wasm/wbg/
/target/
bindings/
Expand Down
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,51 @@ Make sure to have these tools installed:

Once you've installed all prerequisites, clone this repo.

```
```sh
git clone https://github.com/rose-lang/rose
```

Then open a terminal in your clone of it; for instance, if you cloned it via the terminal, run this command:

```
```sh
cd rose/
```

Now you should be able to run everything using Make:

```
```sh
make all
```

## Build

To just produce all build artifacts:

```
```sh
make
```

## Test

To run all tests:

```
```sh
make test
```

## Check

To run any additional checks:

```
```sh
make check
```

## Clean

Sometimes old build artifacts can hide errors. To clean your build:

```
```sh
make clean
```

Expand All @@ -69,13 +69,13 @@ an Internet connection.

To develop the website locally:

```
```sh
make site-deps && npm run --workspace=@rose-lang/site dev
```

Or, if you want to host on your local network, e.g. to test on your phone:

```
```sh
make site-deps && npm run --workspace=@rose-lang/site dev -- --host
```

Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
members = ["crates/*"]
resolver = "2"

[profile.release]
codegen-units = 1
lto = true

# https://github.com/johnthagen/min-sized-rust
[profile.web]
inherits = "release"
codegen-units = 1
lto = true
opt-level = "z"
strip = true
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ test-js: test-core

# build
core: npm wasm
cp README.md packages/core
npm run --workspace=rose build

# test
Expand Down
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,46 @@
<div align="center"><img height="256" src="https://github.com/rose-lang/rose-icons/raw/efcc218832d65970a47bed597ee11cecd3d1cc3c/svg/encircled-rose.svg" /></div>
<h1 align="center">Rose</h1>
<p align="center"><em><a href="https://github.com/rose-lang/rose-icons">icon</a> by <a href="https://github.com/aatxe">Aaron Weiss</a> / <a href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a></em></p>
<p align="center"><a href="https://www.npmjs.com/package/rose"><img src="https://img.shields.io/npm/v/rose" alt="npm" /></a> <a href="LICENSE"><img src="https://img.shields.io/github/license/rose-lang/rose" alt="license" /></a> <a href="https://github.com/rose-lang/rose/actions/workflows/build.yml"><img src="https://github.com/rose-lang/rose/actions/workflows/build.yml/badge.svg" alt="Build" /></a></p>

Rose is an automatic differentiation engine for the web, inspired by [JAX][].

## Installation

With npm:

```sh
npm i rose
```

With Yarn:

```sh
yarn add rose
```

## Usage

This example computes the output and gradient of a simple function that
multiplies together the two components of a vector:

```ts
import { Real, Vec, fn, interp, mul, vjp } from "rose";

const f = fn([Vec(2, Real)], Real, (v) => mul(v[0], v[1]));

const g = fn([Real, Real], Vec(3, Real), (x, y) => {
const { ret, grad } = vjp(f)([x, y]);
const v = grad(1);
return [ret, v[0], v[1]];
});

console.log(interp(g)(2, 3)); // [6, 3, 2]
```

## Contributing

See [`CONTRIBUTING.md`](CONTRIBUTING.md)
See [`CONTRIBUTING.md`][].

[`CONTRIBUTING.md`]: https://github.com/rose-lang/rose/blob/main/CONTRIBUTING.md
[JAX]: http://jax.readthedocs.io/
2 changes: 1 addition & 1 deletion crates/autodiff/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rose-autodiff"
version = "0.0.0"
version = "0.2.0"
edition = "2021"

[dependencies]
Expand Down
6 changes: 2 additions & 4 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[package]
name = "rose"
version = "0.0.0"
version = "0.2.0"
publish = false
edition = "2021"
description = "Extensible interactive autodiff."
license = "MIT"
include = ["src/lib.rs"]

[dependencies]
enumset = "1"
2 changes: 1 addition & 1 deletion crates/interp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rose-interp"
version = "0.0.0"
version = "0.2.0"
publish = false
edition = "2021"

Expand Down
3 changes: 2 additions & 1 deletion crates/transpose/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "rose-transpose"
version = "0.0.0"
version = "0.2.0"
publish = false
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/web/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rose-web"
version = "0.0.0"
version = "0.2.0"
publish = false
edition = "2021"

Expand Down
Loading

0 comments on commit d34184f

Please sign in to comment.