From 5b6c305ab98a375fa1f91a84f5cd197e6bf16558 Mon Sep 17 00:00:00 2001 From: Denis Rosset Date: Tue, 22 Mar 2016 19:39:08 +0800 Subject: [PATCH] Updated website and released 0.11.0.2. --- README.md | 4 +++- docs/src/main/tut/containers.md | 33 +++++++++++++++++--------------- docs/src/main/tut/higherorder.md | 12 +++++++++--- docs/src/main/tut/ptr.md | 2 +- docs/src/site/_config.yml | 4 ++-- docs/src/site/colophon.md | 17 +++++----------- docs/src/site/index.md | 21 +++++++++++++++----- version.sbt | 2 +- 8 files changed, 55 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index f4b21b0..65bfbb8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ ## Metal - fast unboxed data structures for Scala +See the [companion website](https://denisrosset.github.io/metal) and the +associated [tutorials](https://denisrosset.github.io/metal/tutorials.html) Metal provides fast mutable collections whose performance should be close to hand-written data structures using raw primitive arrays. @@ -47,7 +49,7 @@ We currently have a dependency on Spire for two reasons: ## Example -``` +```scala scala> import metal._; import syntax._ import metal._ import syntax._ diff --git a/docs/src/main/tut/containers.md b/docs/src/main/tut/containers.md index 75e24ed..0d0f314 100644 --- a/docs/src/main/tut/containers.md +++ b/docs/src/main/tut/containers.md @@ -6,25 +6,28 @@ section: "tutorials" # Container types -All container names are prefixed by one of: +Metal has three packages containing collections: -- `M`: the mutable variant, -- `I`: the immutable variant, -- `F`: the generic variant, that can be either mutable or immutable. +- `metal.generic`: a generic base trait, corresponding to an immutable or mutable instance, +- `metal.mutable`: mutable collections, +- `metal.immutable`: immutable collections. -The following set implementations are provided (where `x = M/I/F`): +Mutable collections can be used as builders for their immutable counterparts; the `result()` method +will provide an immutable instance, and clear the original collection. -- `xHashSet[K]`: a set implemented using an open addressing scheme, -- `xSortedSet[K]`: a sorted set, using the `Order` type class from `Spire`, -- `xBitSet[Int]` a bitset implementation with (non-negative) `Int` keys. +The following set implementations are provided: + +- `HashSet[K]`: a set implemented using an open addressing scheme, +- `SortedSet[K]`: a sorted set, using the `Order` type class from `Spire`, +- `BitSet` a bitset of implementation with (non-negative) `Int` keys. Two variants of maps are implemented: -- `xHashMap[K,V]`: an hash map using an open addressing scheme, -- `xHashMap2[K,V1,V2]`: an hash map usin an open addressing scheme, storing - values `(V1, V2)`; however, the values of type `V1` and `V2` are never - stored as a tuple to avoid allocations; individual access methods are - provided instead. +- `HashMap[K,V]`: an hash map using an open addressing scheme, +- `HashMap2[K,V1,V2]`: an hash map using an open addressing scheme, storing + values `(V1, V2)`; however, the values of type `V1` and `V2` are not + stored as tuples, avoiding allocations; individual access methods are + provided. -There is also a work-in-progress implementation of mutable and growable arrays -`Buffer` and an immutable wrapper for arrays `IArraySeq`. +There is also a simple array wrapper called `Buffer`, with immutable and mutable +variants; contrary to the other metal data structures, this class is specialized. diff --git a/docs/src/main/tut/higherorder.md b/docs/src/main/tut/higherorder.md index 64e54c9..4efeb9c 100644 --- a/docs/src/main/tut/higherorder.md +++ b/docs/src/main/tut/higherorder.md @@ -10,12 +10,18 @@ Several higher-order functions are available on containers, for example `foreach `exists`, `forall`, `foldLeft` (or `/:`); however, the calling convention is slightly different from the Scala collections to avoid allocating tuples: -```scala -val m = MHashMap(1 -> 2, 3 -> 4) +```tut:silent +import metal._; import syntax._ +val m = mutable.HashMap(1 -> 2, 3 -> 4) +``` + +```tut m.foreach { (k, v) => println(s"($k, $v)") } +``` -// instead of +instead of +```scala m.foreach { case (k, v) => println(s"($k, $v)") } ``` diff --git a/docs/src/main/tut/ptr.md b/docs/src/main/tut/ptr.md index 3761dd9..a3d2ac3 100644 --- a/docs/src/main/tut/ptr.md +++ b/docs/src/main/tut/ptr.md @@ -39,7 +39,7 @@ Thanks to name-based extractors, the code snippet above does not perform any all Several methods are implemented on `Ptr` and `VPtr`, and can be used to access the pointed element. -```scala +```tut import metal._ import metal.syntax._ diff --git a/docs/src/site/_config.yml b/docs/src/site/_config.yml index 7e60a0c..ac744f2 100644 --- a/docs/src/site/_config.yml +++ b/docs/src/site/_config.yml @@ -7,8 +7,8 @@ apidocs: /metal/latest/api githuburl: https://github.com/denisrosset/metal sources: https://github.com/denisrosset/metal/blob/master/ # logourl: https://pbs.twimg.com/profile_images/3005141692/dc8e1eb36b6cbd2b5726f63c50adf7f2.png # uncomment with a real image -# chatname: Gitter -# chaturl: https://gitter.im/... +chatname: Gitter +chaturl: https://gitter.im/denisrosset/metal # buildname: Travis # buildurl: https://travis-ci.org/... collections: diff --git a/docs/src/site/colophon.md b/docs/src/site/colophon.md index 4cf9088..9e22c3a 100644 --- a/docs/src/site/colophon.md +++ b/docs/src/site/colophon.md @@ -4,17 +4,10 @@ title: "Colophon" section: "colophon" --- -Fizz has been made possible by the nice documentation effort provided by -the [Cats](https://github.com/typelevel/cats) scala project. +Metal has been made possible by the earlier work done in [Debox](http://github.com/non/debox). +Random frustration with the quirks of Scala specialization led to the current project. -We also thank the maintainers and contributors of the following projects, on which this template is based. +The `core` subproject could be adapted to deal with off-heap memory, see for example: -* [sbt-doctest](https://github.com/tkawachi/sbt-doctest), a plugin for sbt that generates tests from examples in ScalaDoc, -* [sbt-ghpages](https://github.com/sbt/sbt-ghpages), a SBT plugin to publish Github pages, -* [sbt-site](https://github.com/sbt/sbt-site), a site generation plugin for SBT, -* [tut](https://github.com/tpolecat/tut), a type-checker for example code, -* [sbt-unidoc](https://github.com/sbt/sbt-unidoc), a SBT plugin to create a unified API document across projects. - -We also mention another very similar project: - -* [indoctrinate](https://github.com/stew/indoctrinate), a sample scala project demonstrating a good setup for documentation. +- [LArray](https://github.com/xerial/larray), +- [scala-offheap](https://github.com/densh/scala-offheap). diff --git a/docs/src/site/index.md b/docs/src/site/index.md index e843566..b35a1b8 100644 --- a/docs/src/site/index.md +++ b/docs/src/site/index.md @@ -3,16 +3,27 @@ layout: default title: "Home" section: "home" --- -Fizz is a library written in Scala to pass the FizzBuzz test. +Metal is a Scala library to provide fast unboxed data structures. -

Fizz is currently an experimental +

Metal is currently an experimental project under active development. Feedback and contributions are welcomed as we look to improve the project.

-# Getting Started +# Getting started -Fizz is currently available for Scala 2.11. +Metal is currently available for Scala 2.10 and 2.11. -

Add instructions on how to get started.

+```scala + +resolvers += "bintray/denisrosset" at "http://dl.bintray.com/denisrosset/maven" + +libraryDependencies ++= Seq( + "org.scala-metal" %% "metal-core" % "VERSION", + "org.scala-metal" %% "metal-library" % "VERSION" +) + +``` + +where `VERSION` is the latest published version (see the [Releases](https://github.com/denisrosset/metal/releases)). diff --git a/version.sbt b/version.sbt index 7d53a12..5d12b18 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "0.11.0.1" +version in ThisBuild := "0.11.0.2"