Re: [racket-users] opinions on YAML as communication tool

2016-10-22 Thread Stefan Schmiedl
'John Clements' via Racket Users (21.10. 16:32):

> 
> > On Oct 21, 2016, at 12:42 PM, Tony Garnock-Jones  wrote:
> > 
> > You know how Excel guesses whether things are dates or not and messes
> > things up as a consequence? YAML does that too.

YAML does not guess, the processor does. Just like "undefined"
behavior in C, where decisions are left to the compiler. Still,
some people manage to get some use out of it.

> Interesting. I’m trying to wiggle out of your argument, but it’s
> fairly persuasive. Many thanks for your info. Sigh.

If you know what the contents in the file are going to be and that the
processor handles them to your satisfaction, YAML is a convenient
choice. Yes, like whipping up a quick Excel spreadsheet instead of
doing the right thing and separating the data from the evaluation from
the presentation.

---
billing_id: some number
paid: no
address: |
  Company
  Address
  Location
email: some...@some.tld
billing_date: a date
due_date: another date
vat_percent: some number
items:
- title: words
  effort: number of hours
  rate: hourly rate
- title: words
  effort: number of hours
  rate: hourly rate

I've been using this low-ceremony description for invoices for over a
decade and it works reliably with just the right amount of flexibility.

If you want a "natural" looking text-based description of simple data
structures, YAML is not the worst tool to use. Especially if you're
aware of the limitations.

s.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] opinions on YAML as communication tool

2016-10-21 Thread 'John Clements' via Racket Users

> On Oct 21, 2016, at 12:42 PM, Tony Garnock-Jones  wrote:
> 
> On 10/21/2016 01:21 AM, 'John Clements' via Racket Users wrote:
>> I thought hard about scribble and JSON (and xml, yecch), but I think 
>> that YAML and sexps are the two viable candidates, and I’m guessing 
>> that if non-programmers have to edit it, they’ll be less likely to 
>> botch the YAML one.
> 
> If it's a choice between the two then RUN, do not walk, away from YAML
> and go for sexps. (XML or JSON would also be OK choices.)
> 
> YAML is never the right choice. (In writing this email, I have gone over
> it several times toning down my language.)
> 
> YAML makes XML look simple, elegant and well-designed. The spec is ~80
> pages long. I find it impossible to predict how a YAML processor will
> interpret any given input.
> 
> You know how Excel guesses whether things are dates or not and messes
> things up as a consequence? YAML does that too.
> 
> The "spec" vaguely suggests that applications should use regular
> expressions to take a guess at what type of information is presented in
> a non-explicitly-tagged field. What if there are multiple possible
> interpretations? The spec doesn't help you. No, it explicitly disavows
> responsibility for such weighty decisions, pointing out that ultimately,
> "tag resolution is specific to the application". It's a mess.
> 
> There's room for something that does what YAML aims to do, but YAML
> isn't it.

Interesting. I’m trying to wiggle out of your argument, but it’s fairly 
persuasive. Many thanks for your info. Sigh.

John



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] opinions on YAML as communication tool

2016-10-21 Thread Tony Garnock-Jones
On 10/21/2016 01:21 AM, 'John Clements' via Racket Users wrote:
> I thought hard about scribble and JSON (and xml, yecch), but I think 
> that YAML and sexps are the two viable candidates, and I’m guessing 
> that if non-programmers have to edit it, they’ll be less likely to 
> botch the YAML one.

If it's a choice between the two then RUN, do not walk, away from YAML
and go for sexps. (XML or JSON would also be OK choices.)

YAML is never the right choice. (In writing this email, I have gone over
it several times toning down my language.)

YAML makes XML look simple, elegant and well-designed. The spec is ~80
pages long. I find it impossible to predict how a YAML processor will
interpret any given input.

You know how Excel guesses whether things are dates or not and messes
things up as a consequence? YAML does that too.

The "spec" vaguely suggests that applications should use regular
expressions to take a guess at what type of information is presented in
a non-explicitly-tagged field. What if there are multiple possible
interpretations? The spec doesn't help you. No, it explicitly disavows
responsibility for such weighty decisions, pointing out that ultimately,
"tag resolution is specific to the application". It's a mess.

There's room for something that does what YAML aims to do, but YAML
isn't it.

Tony

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] opinions on YAML as communication tool

2016-10-21 Thread Jay McCarthy
Since we're all just making up stuff, I mostly agree with Ben that if
a spreadsheet is the right tool, then use that tool. There are a few
spreadsheets that support version control internally, like Google Docs
and Microsoft Office Version Tracking.

In addition, there are the elite tools of graybeard grognards like
Emacs org-mode spreadsheets and your truly best option 'sc' [1],
because these have plain-text version-control system friendly formats
from the get-go. `sc` is the only way I spreadsheet. n00bs.

Jay

1. man page from FreeBSD:
https://www.freebsd.org/cgi/man.cgi?query=sc=0=0=FreeBSD+6.0-RELEASE+and+Ports=html

On Fri, Oct 21, 2016 at 12:16 PM, Ben Greenman
 wrote:
> I vote that you stick with Excel & change the version control protocol.
>
> Maybe:
> http://stackoverflow.com/a/17106035/5237018
>
> On Fri, Oct 21, 2016 at 9:22 AM, Matthias Felleisen 
> wrote:
>>
>>
>> See Claire’s paper on cKanren. Scheduling is one of her examples (though
>> small scale).
>>
>>
>>
>> > On Oct 21, 2016, at 7:18 AM, Robby Findler 
>> > wrote:
>> >
>> > Wh? You're not going to design your own language and implement a
>> > syntax colorer in DrRacket for it so they can tell immediately when
>> > something goes wrong?  ;)
>> >
>> > Robby
>> >
>> >
>> > On Fri, Oct 21, 2016 at 12:21 AM, 'John Clements' via Racket Users
>> >  wrote:
>> >> Yet another totally off-topic question for you extremely smart people.
>> >> Well, it’s a language design question, so it’s not *too* off-topic.
>> >>
>> >> I’m temporarily serving as my department’s scheduler (don’t ask).
>> >> Currently, the planning for the future schedule is done using an Excel
>> >> spreadsheet. I try not to hate Microsoft products for knee-jerk reasons, 
>> >> but
>> >> the simple fact is that this format is completely not git-versionable.
>> >>
>> >> This file has to be shared with non-programmers, though it doesn’t
>> >> necessarily have to be *edited* by non-programmers, just read.
>> >>
>> >> I’m currently thinking that the best compromise may be YAML. E.G.
>> >>
>> >> # 2017-2018 schedule:
>> >> alincoln : {fall: [304, 428], winter: [409, special], spring: []} #
>> >> maybe theater?
>> >> gwashington: {fall: [224, 287, 110], winter: sabbatical, spring: [789]}
>> >> # might be able to hire stuffy?
>> >> stuffy: {fall: [234,234,234], winter: [235, 235, 235]}
>> >> …
>> >>
>> >> It looks like a fairly dense format, it’s a text file so it’s
>> >> versionable in a sane way, and you could be fairly flexible in your 
>> >> parsing.
>> >>
>> >> To be fair, sexprs also look pretty good:
>> >>
>> >> ;; 2017-2018 schedule
>> >> ((alincoln ((fall (304 428)) (winter (409 special)) (spring ( ;;
>> >> maybe theater?
>> >> (gwashington ((fall (224 287 110)) (winter sabbatical) (spring (789
>> >> ;; might be able to hire stuffy?
>> >> (stuffy ((fall (234 234 234)) (winter 235 235 235
>> >>
>> >> Also note that there’s no need for this file to contain any information
>> >> about times and rooms, just a mapping from instructor/quarter
>> >> to classes taught, with room for comments.
>> >>
>> >> I thought hard about scribble and JSON (and xml, yecch), but I think
>> >> that YAML and sexps are the two viable candidates, and I’m guessing that 
>> >> if
>> >> non-programmers have to edit it, they’ll be less likely to botch the YAML
>> >> one.
>> >>
>> >> Any opinions?
>> >>
>> >> John
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups "Racket Users" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send
>> >> an email to racket-users+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 "Racket Users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an email to racket-users+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
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+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
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Jay McCarthy
Associate Professor
PLT @ CS @ UMass Lowell
http://jeapostrophe.github.io

   "Wherefore, be not weary in well-doing,
  for ye are laying the foundation of a great work.
And out of small things 

Re: [racket-users] opinions on YAML as communication tool

2016-10-21 Thread Ben Greenman
I vote that you stick with Excel & change the version control protocol.

Maybe:
http://stackoverflow.com/a/17106035/5237018

On Fri, Oct 21, 2016 at 9:22 AM, Matthias Felleisen 
wrote:

>
> See Claire’s paper on cKanren. Scheduling is one of her examples (though
> small scale).
>
>
>
> > On Oct 21, 2016, at 7:18 AM, Robby Findler 
> wrote:
> >
> > Wh? You're not going to design your own language and implement a
> > syntax colorer in DrRacket for it so they can tell immediately when
> > something goes wrong?  ;)
> >
> > Robby
> >
> >
> > On Fri, Oct 21, 2016 at 12:21 AM, 'John Clements' via Racket Users
> >  wrote:
> >> Yet another totally off-topic question for you extremely smart people.
> Well, it’s a language design question, so it’s not *too* off-topic.
> >>
> >> I’m temporarily serving as my department’s scheduler (don’t ask).
> Currently, the planning for the future schedule is done using an Excel
> spreadsheet. I try not to hate Microsoft products for knee-jerk reasons,
> but the simple fact is that this format is completely not git-versionable.
> >>
> >> This file has to be shared with non-programmers, though it doesn’t
> necessarily have to be *edited* by non-programmers, just read.
> >>
> >> I’m currently thinking that the best compromise may be YAML. E.G.
> >>
> >> # 2017-2018 schedule:
> >> alincoln : {fall: [304, 428], winter: [409, special], spring: []} #
> maybe theater?
> >> gwashington: {fall: [224, 287, 110], winter: sabbatical, spring: [789]}
> >> # might be able to hire stuffy?
> >> stuffy: {fall: [234,234,234], winter: [235, 235, 235]}
> >> …
> >>
> >> It looks like a fairly dense format, it’s a text file so it’s
> versionable in a sane way, and you could be fairly flexible in your parsing.
> >>
> >> To be fair, sexprs also look pretty good:
> >>
> >> ;; 2017-2018 schedule
> >> ((alincoln ((fall (304 428)) (winter (409 special)) (spring ( ;;
> maybe theater?
> >> (gwashington ((fall (224 287 110)) (winter sabbatical) (spring (789
> >> ;; might be able to hire stuffy?
> >> (stuffy ((fall (234 234 234)) (winter 235 235 235
> >>
> >> Also note that there’s no need for this file to contain any information
> about times and rooms, just a mapping from instructor/quarter
> >> to classes taught, with room for comments.
> >>
> >> I thought hard about scribble and JSON (and xml, yecch), but I think
> that YAML and sexps are the two viable candidates, and I’m guessing that if
> non-programmers have to edit it, they’ll be less likely to botch the YAML
> one.
> >>
> >> Any opinions?
> >>
> >> John
> >>
> >>
> >>
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-users+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 "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-users+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
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+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 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] opinions on YAML as communication tool

2016-10-21 Thread Matthias Felleisen

See Claire’s paper on cKanren. Scheduling is one of her examples (though small 
scale). 



> On Oct 21, 2016, at 7:18 AM, Robby Findler  
> wrote:
> 
> Wh? You're not going to design your own language and implement a
> syntax colorer in DrRacket for it so they can tell immediately when
> something goes wrong?  ;)
> 
> Robby
> 
> 
> On Fri, Oct 21, 2016 at 12:21 AM, 'John Clements' via Racket Users
>  wrote:
>> Yet another totally off-topic question for you extremely smart people. Well, 
>> it’s a language design question, so it’s not *too* off-topic.
>> 
>> I’m temporarily serving as my department’s scheduler (don’t ask). Currently, 
>> the planning for the future schedule is done using an Excel spreadsheet. I 
>> try not to hate Microsoft products for knee-jerk reasons, but the simple 
>> fact is that this format is completely not git-versionable.
>> 
>> This file has to be shared with non-programmers, though it doesn’t 
>> necessarily have to be *edited* by non-programmers, just read.
>> 
>> I’m currently thinking that the best compromise may be YAML. E.G.
>> 
>> # 2017-2018 schedule:
>> alincoln : {fall: [304, 428], winter: [409, special], spring: []} # maybe 
>> theater?
>> gwashington: {fall: [224, 287, 110], winter: sabbatical, spring: [789]}
>> # might be able to hire stuffy?
>> stuffy: {fall: [234,234,234], winter: [235, 235, 235]}
>> …
>> 
>> It looks like a fairly dense format, it’s a text file so it’s versionable in 
>> a sane way, and you could be fairly flexible in your parsing.
>> 
>> To be fair, sexprs also look pretty good:
>> 
>> ;; 2017-2018 schedule
>> ((alincoln ((fall (304 428)) (winter (409 special)) (spring ( ;; maybe 
>> theater?
>> (gwashington ((fall (224 287 110)) (winter sabbatical) (spring (789
>> ;; might be able to hire stuffy?
>> (stuffy ((fall (234 234 234)) (winter 235 235 235
>> 
>> Also note that there’s no need for this file to contain any information 
>> about times and rooms, just a mapping from instructor/quarter
>> to classes taught, with room for comments.
>> 
>> I thought hard about scribble and JSON (and xml, yecch), but I think that 
>> YAML and sexps are the two viable candidates, and I’m guessing that if 
>> non-programmers have to edit it, they’ll be less likely to botch the YAML 
>> one.
>> 
>> Any opinions?
>> 
>> John
>> 
>> 
>> 
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+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 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+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 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] opinions on YAML as communication tool

2016-10-21 Thread Robby Findler
Wh? You're not going to design your own language and implement a
syntax colorer in DrRacket for it so they can tell immediately when
something goes wrong?  ;)

Robby


On Fri, Oct 21, 2016 at 12:21 AM, 'John Clements' via Racket Users
 wrote:
> Yet another totally off-topic question for you extremely smart people. Well, 
> it’s a language design question, so it’s not *too* off-topic.
>
> I’m temporarily serving as my department’s scheduler (don’t ask). Currently, 
> the planning for the future schedule is done using an Excel spreadsheet. I 
> try not to hate Microsoft products for knee-jerk reasons, but the simple fact 
> is that this format is completely not git-versionable.
>
> This file has to be shared with non-programmers, though it doesn’t 
> necessarily have to be *edited* by non-programmers, just read.
>
> I’m currently thinking that the best compromise may be YAML. E.G.
>
> # 2017-2018 schedule:
> alincoln : {fall: [304, 428], winter: [409, special], spring: []} # maybe 
> theater?
> gwashington: {fall: [224, 287, 110], winter: sabbatical, spring: [789]}
> # might be able to hire stuffy?
> stuffy: {fall: [234,234,234], winter: [235, 235, 235]}
> …
>
> It looks like a fairly dense format, it’s a text file so it’s versionable in 
> a sane way, and you could be fairly flexible in your parsing.
>
> To be fair, sexprs also look pretty good:
>
> ;; 2017-2018 schedule
> ((alincoln ((fall (304 428)) (winter (409 special)) (spring ( ;; maybe 
> theater?
>  (gwashington ((fall (224 287 110)) (winter sabbatical) (spring (789
>  ;; might be able to hire stuffy?
>  (stuffy ((fall (234 234 234)) (winter 235 235 235
>
> Also note that there’s no need for this file to contain any information about 
> times and rooms, just a mapping from instructor/quarter
> to classes taught, with room for comments.
>
> I thought hard about scribble and JSON (and xml, yecch), but I think that 
> YAML and sexps are the two viable candidates, and I’m guessing that if 
> non-programmers have to edit it, they’ll be less likely to botch the YAML one.
>
> Any opinions?
>
> John
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+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 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] opinions on YAML as communication tool

2016-10-21 Thread Stefan Schmiedl
'John Clements' via Racket Users (21.10. 01:21):

> I thought hard about scribble and JSON (and xml, yecch), but I think
> that YAML and sexps are the two viable candidates, and I’m guessing
> that if non-programmers have to edit it, they’ll be less likely to
> botch the YAML one.

My timesheet and invoice backend have been yaml files for 10 years now.
If you intend to let "non-programmers" work on it, I'd go for the
vertical layout:

---
alincoln:
  fall:
  - 304
  - 428
  winter:
  - 409
  - special
  spring: # maybe theater
gwashington:
  fall:
  - 224
  - 287
  - 110
  winter: sabbatical
  spring:
  - 789
# might be able to hire stuffy?
stuffy:
  fall:
  - 234
  - 234
  - 234
  winter:
  - 235
  - 235
  - 235

That being said, sexps have less "magic", which comes in handy if you
end up dealing with strings made of digits which promptly lose leading zeros due
to being converted to integers.

---
bond, james: 007

might well end up with the integer 7, like in the following ruby
example:

>> YAML.load("bond, james: 007")
=> {"bond, james"=>7}

So YAML "looks" easier, but sexps are more consistent.

s.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.