RE: [ClojureScript] Re: clojure.spec
Is it likely that we’ll see a common clojure.spec implementation in .cljc files rather than separate .clj / .cljs files? Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org From: David Nolen -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at https://groups.google.com/group/clojurescript.
[ClojureScript] Re: clojure.spec
There is a tutorial about spec in general at http://clojure.org/guides/spec On Saturday, May 28, 2016 at 8:39:27 PM UTC-5, Jiyin Yiyong wrote: > > > > Looking forward to tutorials~ -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at https://groups.google.com/group/clojurescript.
[ClojureScript] Re: clojure.spec
On Sunday, May 29, 2016 at 6:39:16 AM UTC+8, David Nolen wrote: > clojure.spec has been ported to cljs.spec now available in ClojureScript > master. Will probably cut a release later next week but users are encouraged > to build master and give it a spin. > > > David > > > On Mon, May 23, 2016 at 10:12 AM, Rich Hickeywrote: > Introducing clojure.spec > > > > I'm happy to introduce today clojure.spec, a new core library and support for > data and function specifications in Clojure. > > > > Better communication > > > > Clojure is a dynamic language, and thus far we have relied on documentation > or external libraries to explain the use and behavior of functions and > libraries. But documentation is difficult to produce, is frequently not > maintained, cannot be automatically checked and varies greatly in quality. > Specs are expressive and precise. Including spec in Clojure creates a lingua > franca with which we can state how our programs work and how to use them. > > > > More leverage and power > > > > A key advantage of specifications over documentation is the leverage they > provide. In particular, specs can be utilized by programs in ways that docs > cannot. Defining specs takes effort, and spec aims to maximize the return you > get from making that effort. spec gives you tools for leveraging specs in > documentation, validation, error reporting, destructuring, instrumentation, > test-data generation and generative testing. > > > > Improved developer experience > > > > Error messages from macros are a perennial challenge for new (and > experienced) users of Clojure. specs can be used to conform data in macros > instead of using a custom parser. And Clojure's macro expansion will > automatically use specs, when present, to explain errors to users. This > should result in a greatly improved experience for users when errors occur. > > > > More robust software > > > > Clojure has always been about simplifying the development of robust software. > In all languages, dynamic or not, tests are essential to quality - too many > critical properties are not captured by common type systems. spec has been > designed from the ground up to directly support generative testing via > test.check https://github.com/clojure/test.check. When you use spec you get > generative tests for free. > > > > Taken together, I think the features of spec demonstrate the ongoing > advantages of a powerful dynamic language like Clojure for building robust > software - superior expressivity, instrumentation-enhanced REPL-driven > development, sophisticated testing and more flexible systems. I encourage you > to read the spec rationale and overview http://clojure.org/about/spec. Look > for spec's inclusion in the next alpha release of Clojure, within a day or so. > > > > Note that spec is still alpha, and some details are likely to change. > Feedback welcome. > > > > I hope you find spec useful and powerful! > > > > Rich > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. Looking forward to tutorials~ -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at https://groups.google.com/group/clojurescript.
[ClojureScript] Re: clojure.spec
That's amazing, David - and much sooner than expected. Thanks for porting so fast. Going to use in production asap :) One question: What is the direction regarding macros? Given that error messages are going to be greatly improved once macros are specified I am curious of course- can one just write macro specs in Clojure, instrument and figwheel? An implementation question: Why was this not implemented in conditional Clojure? Just to keep separate codebases or not a good fit for other reasons? -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at https://groups.google.com/group/clojurescript.
[ClojureScript] Re: clojure.spec
clojure.spec has been ported to cljs.spec now available in ClojureScript master. Will probably cut a release later next week but users are encouraged to build master and give it a spin. David On Mon, May 23, 2016 at 10:12 AM, Rich Hickeywrote: > Introducing clojure.spec > > I'm happy to introduce today clojure.spec, a new core library and support > for data and function specifications in Clojure. > > Better communication > > Clojure is a dynamic language, and thus far we have relied on > documentation or external libraries to explain the use and behavior of > functions and libraries. But documentation is difficult to produce, is > frequently not maintained, cannot be automatically checked and varies > greatly in quality. Specs are expressive and precise. Including spec in > Clojure creates a lingua franca with which we can state how our programs > work and how to use them. > > More leverage and power > > A key advantage of specifications over documentation is the leverage they > provide. In particular, specs can be utilized by programs in ways that docs > cannot. Defining specs takes effort, and spec aims to maximize the return > you get from making that effort. spec gives you tools for leveraging specs > in documentation, validation, error reporting, destructuring, > instrumentation, test-data generation and generative testing. > > Improved developer experience > > Error messages from macros are a perennial challenge for new (and > experienced) users of Clojure. specs can be used to conform data in macros > instead of using a custom parser. And Clojure's macro expansion will > automatically use specs, when present, to explain errors to users. This > should result in a greatly improved experience for users when errors occur. > > More robust software > > Clojure has always been about simplifying the development of robust > software. In all languages, dynamic or not, tests are essential to quality > - too many critical properties are not captured by common type systems. > spec has been designed from the ground up to directly support generative > testing via test.check https://github.com/clojure/test.check. When you > use spec you get generative tests for free. > > Taken together, I think the features of spec demonstrate the ongoing > advantages of a powerful dynamic language like Clojure for building robust > software - superior expressivity, instrumentation-enhanced REPL-driven > development, sophisticated testing and more flexible systems. I encourage > you to read the spec rationale and overview http://clojure.org/about/spec. > Look for spec's inclusion in the next alpha release of Clojure, within a > day or so. > > Note that spec is still alpha, and some details are likely to change. > Feedback welcome. > > I hope you find spec useful and powerful! > > Rich > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to cloj...@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. > -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at https://groups.google.com/group/clojurescript.