HNHacker News
TopNewBestAskShowJobs

rbonvall

941 karma · joined February 14, 2009

Roberto Bonvallet — http://mez.cl/a
submissionscomments
rbonvall··on Algebra and the Lambda Calculus (1993)
Yes, that's how it's introduced in the original.
rbonvall··on Algebra and the Lambda Calculus (1993)
It is exactly that: you can simulate a Turing machine using lambda calculus and vice versa.

But the variable substitution schemes you mention are not complex at all. The main rule is beta-reduction, which is really simple: just replace all appearances of the parameter with the value of the argument.

     (λ x . (x y) x) m  →  (m y) m
                        β
rbonvall··on Algebra and the Lambda Calculus (1993)
I took the liberty of converting this to LaTeX: https://www.overleaf.com/read/vbnkshcwhcyk
rbonvall··on Ask HN: What are the best textbooks in your field of expertise?
I cruised through most of it. But the last three chapters really twisted my brain (continuations, the Y combinator, and the metacircular interpreter). I was familiar with the concepts, but figuring out the programs by myself was a tough exercise (I haven't read SICP though).
rbonvall··on Idle Until Urgent
JavaScript is a minefield of unexpected behavior when you try things like this. Besides the issue with this-binding already mentioned in the thread, there are other examples of weird stuff that happens when you don't introduce an apparently redundant lambda:

    > ['10', '10', '10', '10', '10'].map(parseInt)
    [ 10, NaN, 2, 3, 4 ]

    > ['10', '10', '10', '10', '10'].map(x => parseInt(x))
    [ 10, 10, 10, 10, 10 ]
rbonvall··on The once-endangered vicuña is thriving in the Peruvian Andes
That doesn't hold for modern orthography though. Two consecutive ns (e.g. in words innato and perenne) are not pronounced as ñ.
rbonvall··on Simple, correct, fast: in that order
I know a couple of guys that would probably implement isLeap by checking that the lower two bits of the year are not set, then boast about how fast it was, and finally, when told that the logic was incorrect, push back because the additional checks would make it "slower".

In their minds, when things stop being simple, fast trumps correct.

rbonvall··on Functional Data Structures
It's Scribble, Racket's documentation tool.
rbonvall··on Messi Walks Better Than Most Players Run
Another name for the sport in Spanish is "balompié", which comes from "balón" (ball) and "pie" (foot), but it's rarely used.
rbonvall··on UTC Is Enough for Everyone, Right?
Ironically, the article is dated "Spring 2018", which for half the planet doesn't happen yet :)
rbonvall··on High school physics course notes, with JavaScript simulations
The svg is simple and the coordinates are round numbers, so they were probably hand-written:

    <svg class='svgDiagram center' width="300" height="120" viewBox="-15 0 285 120">
      <defs>
        <g id="vector">
          <line x1="0" y1="0" x2="0" y2="45" style="stroke:#000;stroke-width:2" />
          <polygon points="0,50 -5,42 5,42" style="fill:#000;" />
        </g>
      </defs>
      <g transform='translate(100 20) rotate(0)'>
        <rect x="0" y="0" width="80" height="80" stroke='black' stroke-width='2' fill="#fff" />
        <text x="40" y="40" fill="black" text-anchor="middle" alignment-baseline="middle" font-size='28px'>m</text>
      </g>
      <use xlink:href="#vector" transform='translate(100 60) rotate(90)' />
      <text x="40" y="60" font-size='25px' text-anchor="middle" alignment-baseline="middle">F</text>
      <use xlink:href="#vector" transform='translate(180 80) rotate(-90)' />
      <text x="240" y="80" font-size='25px' text-anchor="middle" alignment-baseline="middle">F</text>
      <use xlink:href="#vector" transform='translate(180 40) rotate(-90)' />
      <text x="240" y="40" font-size='25px' text-anchor="middle" alignment-baseline="middle">F</text>
    </svg>
rbonvall··on APL deserves its renaissance too
Take a look at this paper that explores the idea:

https://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/a...

rbonvall··on Leveraging the type system to avoid mistakes
In some languages you don't give field names, just types. You bind fields to names only when pattern matching. For example in Haskell:

    type Year = Int
    type Month = Int
    type Day = Int

    -- fields have no names, just types
    data Date = Date Year Month Day

    -- we bind fields to names only when necessary
    next (Date y 12 31) = Date (y + 1) 1 1
    next (Date y m d)
      | d == daysOf m = Date y (m + 1) 1
      | otherwise     = Date y m (d + 1)
      where daysOf = (!!) [0, 31, 28, 31, 30,
                              31, 30, 31, 31,
                              30, 31, 30, 31]
Is something like this what you mean?
rbonvall··on Batch editing files with ed
The equivalent in vim is:

• qq to start recording a macro in register q,

• w to jump to the second word,

• gUaw to "go uppercase a word",

• j to move to next line (↓ works as well),

• q to stop recording,

• 5@q to apply macro in register q five times.

But in this example I would have probably used ex command:

    :%normal wgUaw
(for every line do as if I had typed wgUaw) or visualy selected the second column as a block and just pressed U.

I'm genuinely interested in someone showing how to do this kind of trasformation in popular modern editors such as Atom and VSCode. Is there such a flexible way as in the classic editors?

rbonvall··on Excel Adds JavaScript and Power BI Support
The examples in the repo are all ES5. Does someone know if it supports ES6? There's no mention in the article.
rbonvall··on Ask HN: What are some tech companies that do not use an open floor plan?
And it sounds like it's identically awful ergonomics.
rbonvall··on Representing the Impractical and Impossible with JDK 10 “var”
I'm sure he means `val` as in Scala, where it is used to define a name that cannot be rebound:

    val x = 1
    var y = 2
    x = 3     // compile error
    y = 4     // ok
It makes it easier to read code since you don't have to keep track of changes in your head.
rbonvall··on ASCIIFlow Infinity
It makes sense. That's a good design decision.
rbonvall··on ASCIIFlow Infinity
I like this. Unfortunately it's not as semantic as I expected:

            X
     +----+XX----------+
     |     XX          |
     |      XX         |
     |       +XXX------+
     |       |   XXXXX
     +-------+       XXX

     If I try to resize
     a rectangle that's
     crossed by a free-form
     curve, it stops being
     a rectangle.
(Now that I think, I could also use this as a feature).
rbonvall··on Ask HN: What Are Your New Years Resolutions or 2018 Goals?
Thanks for the tip, this is indeed something I'd be proud of :)

I decided arbitrarily to make every post self-contained inside a single HTTP request, and it's nice to see this single decision is already 99% of the job.

rbonvall··on Ask HN: What Are Your New Years Resolutions or 2018 Goals?
Mine is to write at least two articles per month on my blog http://mez.cl/a
rbonvall··on An introduction to North Korean graphic design
In Chile we have the acuenta brand, whose packages are almost as plain as you can get: https://i.imgur.com/DeH1KR4.png
rbonvall··on Sabotaged by Polish orthography
Yes it is. For some reason many people strongly believe that the Royal Academy (which oversees the language) forbids the use of accents on capital letters, even when it explicitly claims that this has never been the case:

http://www.rae.es/consultas/tilde-en-las-mayusculas

rbonvall··on Scala: Consider syntax with significant indentation
Indeed, there is already a proposal for an enum syntax in dotty that looks almost exactly like that:

    enum Tree[T] {
      case Branch(t: Tree[T])
      case Leaf(t: T)
    }
https://github.com/lampepfl/dotty/issues/1970
rbonvall··on Swift is like Kotlin
As a native Spanish speaker I'm not aware of any negative connotations of the word bandera. In Spanish it just means "flag", so any other meaning is hard to google for. What am I missing? Just curious.
rbonvall··on Simon Tatham's Portable Puzzle Collection
Same here. I only install a handful of apps in my phone, and this is one of them. One wrapping-11x11 game of "Net" is just right for my short subway commute.
rbonvall··on Why My Handwriting Sucks: A Typographical Analysis
Note that handwriting styles are not called fonts, but hands. A font is basically a set of prefabricated letters.
rbonvall··on Me and SVG
I would love to have something like TikZ for the browser.
rbonvall··on Fun at the Unix Terminal
Not all commands accept input as arguments, so it's still a good trick to know.
rbonvall··on ₹Query (jQuery for India)
In the same vein, Skala was announced yesterday: http://scala-lang.org/blog/2017/04/01/announcing-skala.html
← PreviousPage 5 of 11Next →