Hacker News new | ask | show | jobs
by ricardobeat 4234 days ago
Wow, now I'm curious about the language. Looks like made-up gibberish at first sight:

    ++  lax                                           ::    lax:as:go
      |_  [her=ship dur=dore]                         ::  per client
      ++  cluy                                        ::    cluy:lax:as:go
        ^-  [p=life q=gens r=acru]                    ::  client crypto
        ?~  lew.wod.dur  !!
        ?.  =(fak.ton r.i.lew.wod.dur)  ~|([%client-wrong-fake her] !!)
        :+  p.p.q.i.lew.wod.dur
          q.q.i.lew.wod.dur
        (haul r.q.i.lew.wod.dur)
      ::
1 comments

Suppose we wrote this with keywords. I can't stomach a naked keyword so I'll put a colon on the front. We might write:

  :function lax {
    :object :tuple{her: ship dur: dore}  {
      :function cluy {
        :produce :tuple{p: life q: gens r: acru}
        :ifno lew.wod.dur  :error
        :unless (equals fak.ton r.i.lew.wod.dur) {
          :record :tuple{%client-wrong-fake her}
          :error
        } :then {
          :tuple {
             p.p.q.i.lew.wod.dur
             q.q.i.lew.wod.dur
             (haul r.q.i.lew.wod.dur)
          }
        }
      }
    }
  }
Is this better? Arguably, it's easier to learn. But I'm not sure I would regard it as better.

Also, for your convenience we've assigned CVC nonsense names to all the ASCII characters. Pasting from the source:

  ++  ace  (just ' ')
  ++  bar  (just '|')
  ++  bas  (just '\\')
  ++  buc  (just '$')
  ++  cab  (just '_')
  ++  cen  (just '%')
  ++  col  (just ':')
  ++  com  (just ',')
  ++  doq  (just '"')
  ++  dot  (just '.')
  ++  fas  (just '/')
  ++  gal  (just '<')
  ++  gar  (just '>')
  ++  hax  (just '#')
  ++  kel  (just '{')
  ++  ker  (just '}')
  ++  ket  (just '^')
  ++  lus  (just '+')
  ++  hep  (just '-')
  ++  pel  (just '(')
  ++  pam  (just '&')
  ++  per  (just ')')
  ++  pat  (just '@')
  ++  sel  (just '[')
  ++  sem  (just ';')
  ++  ser  (just ']')
  ++  sig  (just '~')
  ++  soq  (just '\'')
  ++  tar  (just '*')
  ++  tec  (just '`')
  ++  tis  (just '=')
  ++  wut  (just '?')
  ++  zap  (just '!')
One of the problems with using these handy little glyphs in syntax (and an even worse problem with using Unicode glyphs in programming, btw) is that "semicolon" is not convenient to say. The length of the vocalization matters a lot to how you think about a symbol, even if you don't often say it.
> Is this better? Arguably, it's easier to learn. But I'm not sure I would regard it as better.

For what criteria of 'better'?

I can't really present an argument either way since I'm not familiar enough with the language, but it does seem like it requires a fairly high amount of cognitive overhead for... I'm not sure exactly. Keystrokes?

There is something to be said about the efficiency of glyph-based writing systems like kanji, so APL might've been on to something, but overloading common ascii characters and creating meaningless words? That seems like a lot of noise for brains without extraordinary working memory to filter out on a regular basis.

I'm sure thinking and writing in it are fine (even brainfuck isn't difficult to write), but for something intending to be the backbone of the internet, I would've assumed maintainability to have been the most important design goal.

Essentially, I'd say most peoples' brains are better at associative memory than they think they are.

When you see a digraph like -> or ?: in C, do you think "hyphen greater-than" or "question-colon"? Your brain long ago learned to treat these as individual symbols, not strings of two characters. And this despite not even having easy-to-say names for them. (In Hoon they are "hepgar" and "wutcol" respectively.)

The digraph operators are not a large problem for me. I'm used to Perl, so I'm sure I can master them. But what is a lew.wod.dur, and what is lax supposed to mean? What happened to variable names that made at least a nod to descriptiveness? Why do you think adding a two-word comment to a function is enough to make it all crystal clear?