Skip to Content.
Sympa Menu

k-user - [K-user] Our Experience Hacking a JS model in K

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

[K-user] Our Experience Hacking a JS model in K


Chronological Thread 
  • From: Robby Findler <robby AT eecs.northwestern.edu>
  • To: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
  • Cc: Dylan Hirshkowitz <DylanHirshkowitz2014 AT u.northwestern.edu>, John Greene <johngreene2012 AT u.northwestern.edu>, Josiah Matlack <jmatlack AT u.northwestern.edu>, Kaicheng Zhang <kaichengzhang2016 AT u.northwestern.edu>, Lee Fan <LeeFan2014 AT u.northwestern.edu>, Maciej Swiech <maciejswiech2007 AT u.northwestern.edu>, Daniel Lieberman <daniellieberman2012 AT u.northwestern.edu>, Burke Fetscher <burke.fetscher AT eecs.northwestern.edu>, Ethan Romba <ethanromba AT u.northwestern.edu>, Matthew Wampler-Doty <negacthulhu AT gmail.com>
  • Subject: [K-user] Our Experience Hacking a JS model in K
  • Date: Fri, 7 Dec 2012 12:48:21 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

Hi all:

The cc'd and I just spent the last quarter learning K, starting with
the Imp model and then branching out via JavaScript. We ended up with
a model that explains functions in JavaScript, along with variables
and "with" (these turned out to be pretty crazy).

Here's a link to the course webpage, which has the poster version of
the language and a pointer to the github repo we used that contains
our code:

http://www.eecs.northwestern.edu/~robby/courses/395-495-2012-fall/

I also have two (hopefully constructive) criticisms for you guys. Let
me say upfront that overall we were happy with K and these things are
definitely in things in the "icing on the cake" category.

1) I think we all got to the point where we could predict how a
well-formed K program would behave, but we couldn't always predict if
a program was well-formed and (as was the common case) when it wasn't
what we should do about it. We often resorted to reading other K code
(k-prelude.k was a gold mine in this respect).

I believe the real problem here is the lack of a reference manual for
the language. There is a lot of tutorial information (and that kind of
documentation is important and very helpful) but when you want to head
off on your own, you need to understand what the basic building blocks
of the language are and what the legal combinations of them in a more
systematic manner. Along these lines I'd say that we definitely
understood the => and ... operators and how they interact with the
cells, but we failed to understand what's really going on with sets vs
cons-lists vs associative-lists and when we had which of those. I
think it probably hurt us more than others because we're not really
familiar with day-to-day life in a maude world so there were lots of
"culture" clashes; little things that appear big until you realize
you'd done something stupid in an uninteresting way.

2) We really missed good unit testing support. If you look at the git
repo, you'll see that we rolled our own using a Racket script that
calls krun, but it would have been much better if we could have
written down examples for how we expected rules to behave right next
to the rules and gotten k to tell us when our expectations didn't
match reality. (Our test support, for example, works only after you
have printing working and isn't convenient for working with the
contents of individual cells, which meant that for most of the quarter
we didn't really get to use it.)

That said, we had a great time hacking in K. Thank you very much for
giving us this opportunity!

Best regards,

Robby




Archive powered by MHonArc 2.6.16.

Top of Page