
Mystery Languages - matt_d
http://blog.brownplt.org/2018/07/05/mystery-languages.html
======
Shoop
> or wrap the index to a valid one (like Python)?

Python doesn't wrap indices to a valid one. However, it does allow for
negative indices which are shorthand for the length of the list plus that
negative index.

    
    
      >>> a = [1, 2, 3]
      >>> a[3]
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      IndexError: list index out of range
      >>> a[-1]
      3
      >>> a[-3]
      1
      >>> a[-4]
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      IndexError: list index out of range

~~~
baxter001
That jumped out at me too, also an excellent example of where poking at a
'mystery language' rather than reading the documentation can lead to some
really weird mental models (I'm reminded of myself trying to force a haskell
program together until it ran).

On that note, how the hell would you understand currying or do notation by
trial and error?

I wonder if they implemented one of their languages with true wrapping index
behaviour.

~~~
skrishnamurthi
Our SNAPL paper [[http://cs.brown.edu/~sk/Publications/Papers/Published/pkf-
te...](http://cs.brown.edu/~sk/Publications/Papers/Published/pkf-teach-pl-exp-
adv-think/)] has data on how long students spend. It turns out relatively few
hours for pretty high levels of attainment (i.e., of finding the languages).

But as @justinpombrio says, this is also tied to a particular pedagogy. The
day after the homework is due, in class, we:

\- collectively build up a classifier (programs that tell the languages apart)

\- present the intended theory (our ground truth of what is going on)

and then spend the remaining time (30+ minutes) talking about which languages
did those particular things, and — most importantly — _why_ those languages
did that, especially for the "weird" behaviors. There were often very good
reasons for doing so, when viewed in a historical context. In this regard, I'm
very much a historicist in the Kuhnian sense.

------
User23
"Syntax vs. Semantics: We are frustrated by how frequently discussions about
programming languages revolve around syntax."

I couldn't agree more strongly. Syntax is bikeshedding and semantics is
language design. My favorite example is the wholesale abandonment of
M-Expressions by the early lispers. I don't know of any other (kind of)
mainstream language community that has so wholeheartedly put semantics first.
Maybe the ML family? Any other examples?

~~~
skrishnamurthi
No, syntax is not merely bikeshedding, but endless discussions about it can
certainly turn into that. I don't know what qualifies as "mainstream", but
anything that sprang from the head of Milner, you can be sure, put semantics
first. As, for that matter, did work from Dijkstra, Hoare, etc. Lots of good
semantics work out there that has often indirectly had a huge influence on the
mainstream.

~~~
User23
I was engaging in a little hyperbole. Dijkstra has some compelling monographs
on the value of choosing good syntax, it's true. You understood my meaning
though as referring to the standard substandard discussion of the subject.

Yeah Dijkstra, Hoare, Knuth, Lamport, and friends are basically my heroes.
Algol 60 is fine work. It has a very readable syntax. It's easy to see why
it's even now used for scholarly publication. Hadn't heard of Milner though,
any suggested reading?

~~~
skrishnamurthi
I have to assume you're trolling me at this point, but just in case not:

[https://amturing.acm.org/award_winners/milner_1569367.cfm](https://amturing.acm.org/award_winners/milner_1569367.cfm)

[https://en.wikipedia.org/wiki/Robin_Milner](https://en.wikipedia.org/wiki/Robin_Milner)

ML did not spring fully-formed from the heads of the creators of OCaml…

~~~
User23
I meant a work or works by Milner

------
scentoni
I was hoping this was about things like
[https://en.wikipedia.org/wiki/Linear_A](https://en.wikipedia.org/wiki/Linear_A)
[https://en.wikipedia.org/wiki/Etruscan_language](https://en.wikipedia.org/wiki/Etruscan_language)
and fearing it was about things like
[https://en.wikipedia.org/wiki/Senzar_language](https://en.wikipedia.org/wiki/Senzar_language)

------
ibejoeb
Very interesting as a pedagogical technique. This was never included in the
curricula in any of the programs I've taken, except in those that are
explicitly designed as adversarial, but those were more from the security
perspective. I love the concept of teaching "tinkering" and black-box
investigation as part of fundamentals. Is this is an exclusively Brown thing?

~~~
kevmo314
A bunch of schools include CTF-type reverse engineering challenges as part of
a course. IMO those tend to be a little more addicting as well, as there's the
instant feedback that you have the correct answer.

~~~
skrishnamurthi
If you know of other places that do it specifically for programming languages,
using this kind of approach, let us know so we can study and attribute
properly. Thanks. (In the 2012 PL MOOC that Joe Politz and I ran, we had CTF-
style exercises, which are still on the Web.)

Note: CTF is a very different kind of thing than what we are doing here. In
CTF, usually, there is some clear sense of a goal and you are (as you note)
given a measure of how close you are, or at least told when you've Ced The F.
In mystery languages, there is no well-defined end and there is no measure.
Also, your job is not to break one thing, but rather to break the _difference_
between _multiple_ things. That kind of «differential reasoning» is its own
separate sort of activity.

As an aside, real life often does not give you a measure or an indication of
when you're done. Sometimes, maybe, you've set yourself your own goal (e.g.,
to steal a particular resource), and then you may be able to tell. But
otherwise, especially when it comes to learning new things (like programming
languages), I'd say this is a more authentic learning activity. Indeed, it
grew out in part from my trying to reflect on how I myself approached a new
language. So, at least, it's more authentic to me. (-:

~~~
kevmo314
> Also, your job is not to break one thing, but rather to break the difference
> between multiple things. That kind of «differential reasoning» is its own
> separate sort of activity.

This seems like splitting hairs. You could wrap this differential reasoning
assignment in a function that returns true iff the outputs are different and
achieve the same CTF-style behavior. The only difference here is that students
get one assignment at a time instead.

~~~
skrishnamurthi
Reductionist theories don't work out that way in practice, but sure: Build it,
teach it, and then I'd be happy to talk about your experience and how the
difference is only "splitting hairs".

------
vkalantar
I tried this out, and DrRacket crashed whenever I used #lang Numbers (or other
mystery languages) - did anyone else encounter this?

~~~
skrishnamurthi
What version of DrRacket are you in?

~~~
justinpombrio
In addition, what do you mean by "crashed" \- did the whole application quit
or hang, or was there an error message?

