Hi,

It took a little longer than expected, but Speculation
<https://github.com/english/speculation>, a Ruby port of clojure.spec, is
now in a good place. It has the main features of clojure.spec: validation,
conforming, generation, and instrumentation. What's missing is an
equivalent of `s/describe
<https://clojure.github.io/clojure/branch-master/clojure.spec-api.html#clojure.spec/describe>`
and documentation integration.

My goal for Speculation is to provide, as close as possible, clojure.spec
in Ruby. There's nothing original in there - the API and implementation are
largely lifted from clojure.spec (with a few parentheses re-arranged).

If there are any Rubyists on this list wishing we had a clojure.spec
equivalent then I'd be keen to hear your thoughts on Speculation. I have a
port
<https://github.com/english/speculation/blob/master/examples/spec_guide.rb>
of Alex Miller's Spec guide <https://clojure.org/guides/spec> and the
Codebreaker
<https://github.com/english/speculation/blob/master/examples/codebreaker.rb>
exercise
from David Chelimsky's Interactive development with clojure.spec
<http://blog.cognitect.com/blog/2016/10/5/interactive-development-with-clojurespec>
blog post that show off most features, as well as a simple web app
<https://github.com/english/speculation/tree/master/examples/sinatra-web-app>
demonstrating
API request validation and error reporting.

The documentation and examples are a little slim at the moment, and
probably make little sense without prior exposure to clojure.spec. I plan
to address this before sharing it with the larger Ruby community.

Jamie

On 22 January 2017 at 06:38, Xiyang Chen <settingh...@gmail.com> wrote:

> Hi,
>
> In addition to js.spec, here is another alternative I made: Clause.js
> <http://github.com/clausejs/clausejs>.
>
> What's currently working is conformation and validation for regex specs &
> function specs. Next on the roadmap is data generation.
>
> I've also made a sub-library for documentation generation called
> clausejs-docgen
> <https://github.com/clausejs/clausejs/tree/master/packages/clausejs-docgen>.
> I have been using this library to generate Clause.js's own documentation,
> which has been a pretty fun experiment.
>
> There is also a "syntax" function that takes an fspec, computes all the
> possibilities (on all the "or" specs contained within the fspec), and
> generates a list of concise syntax representations. You can find an example
> here <https://clause.js.org/#/clause>.
>
> Cheers,
> Xiyang
>
> On Thursday, December 29, 2016 at 1:17:47 PM UTC-5, Rich Morin wrote:
>>
>> Does anyone know of efforts to port clojure.spec to other languages?  I
>> thought I had seen someone mention versions for Haskell and Scala, but I
>> can't find any information on this.  FWIW, my interest is in having
>> elixir.spec and/or ruby.spec...
>>
>> -r
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/to
> pic/clojure/LHg1eS3uBbs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to