clojure-dev

Issues: https://clojure.atlassian.net/browse/CLJ | Guide: https://insideclojure.org/2015/05/01/contributing-clojure/
devn 2019-06-06T00:10:52.003300Z

Speaking as someone who doesn’t own a project, I think it might be nice to create them with the caveat that project owners ultimately are in charge of changing them to fit their needs.

alexmiller 2019-06-06T01:07:51.004900Z

Project owners should have that capability now afaik (but I haven’t tried it)

2019-06-06T01:10:33.005500Z

I was able to change the auto-assignee, at least I did that because I realized I wasn't getting emails for new tickets like I used to getting assigned will probably mean I get an email

alexmiller 2019-06-06T16:21:05.006200Z

FYI, Contegix is experiencing a wide network outage. Contegix hosts the box for the Clojure build server (http://build.clojure.org) and that is currently unavailable.

polymeris 2019-06-06T18:03:11.007Z

I'd like to reply to https://clojure.atlassian.net/projects/TCHECK/issues/TCHECK-155 -- it seems an account was created for me, but I don't have access to any projects?

alexmiller 2019-06-06T18:14:29.007200Z

let me check...

alexmiller 2019-06-06T18:16:18.007400Z

oh, this came through the portal

2019-06-06T18:45:40.007900Z

speaking of which, can anybody authoritatively comment on TCHECK-155?

2019-06-06T18:49:14.009300Z

(that was not a question about jira commenting capabilities, it was a request for clojure design info)

2019-06-06T18:49:36.009800Z

it looks like the same old thing, the assumption that the universe of things that are valid for serialization(pr,read,edn) is the same as the universe of things

2019-06-06T18:51:11.010700Z

well in particular I'm thinking that exactly one of the following must be true A) the clojure reader accepting :/ is a bug and it should be fixed B) test.check should generate :/, because it's de facto valid and so useful for testing

2019-06-06T18:51:49.011400Z

but I can't tell which of those is true without an Official Ruling

polymeris 2019-06-06T19:00:11.014300Z

My reading of https://clojure.org/reference/reader#_reader_forms is that: • keywords are symbols that start with :. • / is only valid in a symbol either by itself or separating ns from name (neither of which :/ satisfies)

2019-06-06T19:04:05.014600Z

you are missing the reader part of the url

2019-06-06T19:04:28.015200Z

or I am missing the entire context

2019-06-06T19:04:45.016Z

(A is all about the reader)

2019-06-06T19:06:04.016600Z

> it looks like the same old thing, the assumption that the universe of things that are valid for serialization(pr,read,edn) is the same as the universe of things this doesn't sound right, because in this case :/ is fully readable and printable; the only thing it's at odds with is the documentation (and apparently something very subtle in cljs)

2019-06-06T19:07:04.017900Z

but the ticket seems to take the approach of removing :/ from the generated keywords

2019-06-06T19:07:05.018Z

if we're committed to a situation where certain kinds of code subtly break and the only way to know that you shouldn't have written that code is to read things on <http://clojure.org|clojure.org>, then that puts test.check in a pretty interesting position philosophically

alexmiller 2019-06-06T19:07:51.018900Z

that's the situation

2019-06-06T19:08:15.019700Z

so the question is is the keyword generator only supposed to generate keywords that serialize, or can it generate any possible keyword object that can exist

alexmiller 2019-06-06T19:08:17.019800Z

http://clojure.org is state what is supported, the code allows more than that but does not commit to it always working

2019-06-06T19:08:29.020100Z

@hiredman no, :/ can already serialize

alexmiller 2019-06-06T19:09:00.021300Z

:/ is kind of a weird case because / was kind of wedged into symbol support and namespaced symbol support later on

2019-06-06T19:09:04.021500Z

sure, but the comment on the ticket, and it looks like the patch on the ticket removes it from the generator because it doesn't match the edn spec

2019-06-06T19:09:37.022100Z

where the edn spec is a spec about serialization, not a spec about objects that can exist in a runtime

2019-06-06T19:09:59.022800Z

(regardless of how faithful any of the readers are to that spec)

2019-06-06T19:10:09.023Z

I don't think test.check should care about what the edn spec says if it differs from what clojure.core/{read,pr} do

2019-06-06T19:10:18.023200Z

or what they're intended to do, at least

2019-06-06T19:10:45.023900Z

why should it care about what read/pr do even?

2019-06-06T19:11:59.025400Z

I think that's more compelling than saying it should care about edn; edn's only interesting inasmuch as it's evidence for what's officially supported in clojure, but docs/comments about the clojure language itself are what we actually care about

alexmiller 2019-06-06T19:12:18.026Z

edn is intentionally a subset of clojure's syntax

2019-06-06T19:12:22.026200Z

you could also say it should just generate any object that can be created in any fashion, I'm not distinguishing those two at the moment

2019-06-06T19:13:01.027Z

@alexmiller and that particular relationship (subset) doesn't resolve the :/ question -- :/ could be invalid edn, but still valid clojure

alexmiller 2019-06-06T19:13:44.027800Z

right, my point being that edn is interesting because it's a format for external data files and is more restrictive than clojure

alexmiller 2019-06-06T19:13:59.028400Z

such that it may be important to test with the more restrictive set

2019-06-06T19:14:04.028600Z

yeah, I imagine knowing it's a subset means that if something is valid edn, it must be valid clojure as well

alexmiller 2019-06-06T19:14:29.029Z

edn < clojure per spec < clojure per code

alexmiller 2019-06-06T19:14:58.029500Z

any of those are potentially interesting for generators

2019-06-06T19:15:34.030600Z

yeah a cute thing test.check could do is test if (read-string ":/") succeeds, and avoid generating it if not that'd make it do The Right Thing in some future world where the reader gets stricter

alexmiller 2019-06-06T19:15:51.031100Z

first question for this ticket is, can we resolve which set :/ is in

2019-06-06T19:16:11.031600Z

based on what you've said already I'd assume it's only clojure-per-code

alexmiller 2019-06-06T19:16:28.032Z

well, I might be able to resolve this better with the man upstairs

2019-06-06T19:19:34.033200Z

I'd be much more comfortable with this situation if :/ wasn't broken in cljs

2019-06-06T19:20:36.034Z

I think that's the worst part; I'd argue either the cljs compiler & runtime should be modified to prevent creating :/, or the hash-code or whatever the underlying problem is should be fixed

2019-06-06T19:23:03.034700Z

I suppose test.check can detect that bug at load-time as well, and suppress generation of :/

2019-06-06T19:24:36.035900Z

but in general it's not obvious what a data generation library should do in this situation, short of providing multiple categories of generators 😕

alexmiller 2019-06-06T19:25:35.036400Z

I frequently want generators from test.check that are similar to the existing ones in this kind of way

2019-06-06T19:25:50.036600Z

meaning you want stricter generators?

alexmiller 2019-06-06T19:25:56.036800Z

yes

alexmiller 2019-06-06T19:26:58.038300Z

I have no particular example in my head at the moment but have frequently found myself staring at the docs for generator namespace wishing I had something like what's there but slightly different

2019-06-06T19:26:59.038500Z

I thought a decent amount about expanding the generator API to make it easier to customize them

alexmiller 2019-06-06T19:27:28.038900Z

the next time I'm in this bucket I'll drop you a note somewhere with an example

2019-06-06T19:27:56.039400Z

the cljs :/ bug seems to make them similar to NaNs

alexmiller 2019-06-06T19:29:04.040200Z

that seems bad and fixable, even in the gray area of maybe-allowed

2019-06-06T19:29:21.040600Z

the idea was basically to add a third arg (in addition to rand and size), presumably called opts, which is just a map that gets passed down to leaves the same way size does, and can be customized in a similar sort of way

2019-06-06T19:30:01.041300Z

off the top of my head I can't remember any downsides

alexmiller 2019-06-06T19:30:02.041400Z

I'd really like more flexible primitives so I can compose myself to glory, rather than options

2019-06-06T19:30:52.041800Z

it's easy to make your own primitives

2019-06-06T19:31:07.042200Z

the options would especially target situations where somebody else (e.g., spec) is assembling the generator for you

2019-06-06T19:32:19.043Z

e.g., (def keyword-but-not-slash (gen/such-that (complement #{:/}) gen/keyword))

2019-06-06T19:32:46.043400Z

the hard part is tweaking a complex generator to never generate :/ anywhere

2019-06-06T19:33:25.043800Z

if there were an obvious right answer to this I would have done it already :face_with_rolling_eyes:

2019-06-06T19:37:02.044700Z

e.g., gen/any is not very useful if it has to dictate all these choices, and you'd get a combinatorial explosion of gen/anys if you wanted to provide all possibilities

alexmiller 2019-06-06T19:41:22.044900Z

does test.check have edn-makers?

alexmiller 2019-06-06T19:41:36.045300Z

or was that Stu's generative stuff that did that

alexmiller 2019-06-06T19:42:06.045600Z

or maybe it's in clojure's own tests

alexmiller 2019-06-06T19:43:18.046100Z

we use that a bit in some tests

2019-06-06T19:43:55.046300Z

that pool idea is interesting

2019-06-06T19:44:24.046500Z

I guess that's all against data.generators

alexmiller 2019-06-06T19:47:54.046700Z

Yeah

mfikes 2019-06-06T23:46:49.048400Z

With the latest homebrew release, I'm getting an odd thing where, in /usr/local/bin/clojure, it ends up with

install_dir=PREFIX
Not sure what the root cause might be yet; just sharing.