shocon


License

License

GroupId

GroupId

org.querki
ArtifactId

ArtifactId

shocon_sjs0.6_2.11
Last Version

Last Version

0.4
Release Date

Release Date

Type

Type

jar
Description

Description

shocon
shocon
Project Organization

Project Organization

org.querki
Source Code Management

Source Code Management

https://github.com/jducoeur/shocon

Download shocon_sjs0.6_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/org.querki/shocon_sjs0.6_2.11/ -->
<dependency>
    <groupId>org.querki</groupId>
    <artifactId>shocon_sjs0.6_2.11</artifactId>
    <version>0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.querki/shocon_sjs0.6_2.11/
implementation 'org.querki:shocon_sjs0.6_2.11:0.4'
// https://jarcasting.com/artifacts/org.querki/shocon_sjs0.6_2.11/
implementation ("org.querki:shocon_sjs0.6_2.11:0.4")
'org.querki:shocon_sjs0.6_2.11:jar:0.4'
<dependency org="org.querki" name="shocon_sjs0.6_2.11" rev="0.4">
  <artifact name="shocon_sjs0.6_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.querki', module='shocon_sjs0.6_2.11', version='0.4')
)
libraryDependencies += "org.querki" % "shocon_sjs0.6_2.11" % "0.4"
[org.querki/shocon_sjs0.6_2.11 "0.4"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.8
org.scala-js : scalajs-library_2.11 jar 0.6.9
com.lihaoyi : fastparse_sjs0.6_2.11 jar 0.4.3

Project Modules

There are no modules declared in this project.

shocon

Pure-Scala implementation of HOCON, suitable for cross-platform use

Usage

Include the following in your sbt file:

"org.querki" %%% "shocon" % "0.4"

Note that this has some fairly old dependencies at the moment, mainly because Querki is a bit behind the times. Those will be updated in due course. (The lack of unit tests is a consequence of this -- once it is updated enough to use ScalaTest.JS, we can do that properly.)

What It Is

Suffice it to say, this is a very preliminary, very partial, reimplementation of the HOCON file format, in pure Scala. Its purpose is mainly to enable a Scala.js client and a Scala server to share the same data file.

As it says, as of this writing this is only a beginning. This library doesn't handle all of the syntax, it's way too forgiving of some syntax errors, and doesn't yet deal with some common constructs. But it does cope with the most common format reasonably well. Pull requests are welcomed for fleshing out the details and getting them right.

This is not yet attempting to be a full-fledged config system: this library doesn't yet have any semantics for what to do with this file, it just produces a simple tree of the contents. We may eventually want to make this richer, but that will require a lot of discussion about, eg, what it means to "include" another file when we're interpreting this client-side. I suspect that the parser will need to be embedded in some richer factories, with JS and JVM implementations.

Under the hood, this is based on FastParse, so it is expected to run reasonably quickly.

Release Notes

  • 0.4 -- discovered that we weren't using FastParse well, and Shocon was running idiotically slowly. Added some cuts, and switched to using FP's built-in character type recognizers, which appears to have sped things up by over 80%. (Querki's config file parse improved from over 2.5 seconds to under 500ms.)

Versions

Version
0.4
0.3
0.2
0.1