Right now Amazon is showing two kinds of recommendations: 1) "the customers that bought this also bought…". That one can show you books that are totally unrelated to the book you are buying or even to your actual interests. 2) the "Sponsored products related to this item". I don't see why they couldn't substitute one of them for "books the author of this book recommends", or something like that.
Honestly I can't tell sometimes if HN is all just satirical internet comments. I read the article, chuckled at the exchange with Joe Armstrong, then opened the HN comments to look at all the grumbling.
"One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs." - Robert Firth
That's some deep theosophical kung-fu you bring there, grasshopper. But seeing as the words of the Torah existed before the creation of the world, it might just be that you are correct.
It's a category error to conflate article titles and website names, but I'll play along.
Misleading? Arguably, but I don't think it's much of a stretch from "Hacker News" to "news for hackers" to "anything that good hackers would find interesting", which is the mandate of the site (https://news.ycombinator.com/newsguidelines.html).
I know all that. Long time Erlang dev, former RabbitMQ core dev, so yeah, I've heard already about the Prolog story. Interesting you talk about the Actor Model, since even Robert Virding has said that when they created Erlang they had no idea there was a thing called "Actor Model".
Wow! Ok. Well yes, as far as I know both Joe and Rob agree on that it is accident that Erlang have implemented 'actor model' thing. Also its interesting to note that functional nature of Erlang is very different to ML-family languages.
Authors used all these functional stuff because of pragmatics in the first place and not because of solid theory underpinnings.
Go get your break, while you are at it, get a laugh or two, because that's what this article is supposed to be about. nobody is so silly to pretend Knuth was describing Erlang on his book.
>For me what's striking about Erlang syntax is the meaning of the semi-colon and the period, as function clause separator. Most of the rest is just vanilla FP lang syntax.
It's strikes me that everybody notices the pattern matching part, but not the way the clauses are separated, which AFAIK, it's something used by Erlang Syntax only.
And yeah, after working in Erlang and other FP langs for the past 6 years I kinda know this is called pattern matching ;-)
Well... and English syntax. In English, you can specify a list of things by separating each thing with a semicolon and then a sentence is terminated by a period. Example:
> Today I would like you to buy coffee; talk to Sarah about the party if you can, otherwise send her a text; drop off the kids; meet me at soccer practise.
You see how the sentence is terminated with a period, each individual item in the list is separated by a semicolon, and the comma is free to use inside each item to indicate related clauses. I've changed nothing about the structure of that list, except replaced the items with function definitions.
> Today I would like you to define f(m, n, r, 1) as f(m, n, remainder of m divided by n, 2); f(m, n, r, 2) as n if r is 0, otherwise as f (m, n, r, 3); f(m, n, p, 3) as f(n, p, p, 1).
It's the same thing, only we've replaced the mundane everyday tasks with function definitions. Now reformat the thing and we get
Today I would like you to define
f(m, n, r, 1) = f(m, n, remainder of m divided by n, 2);
f(m, n, r, 2) = n if r is 0,
f (m, n, r, 3) otherwise;
f(m, n, p, 3) = f(n, p, p, 1).
Sure, Erlang syntax happens to coincide with the syntax of English, and I'm not sure whether this was intentional or not, but it certainly has nothing to do with Knuth.
Really you can use semi-colons on a sentence and then end the sentence with a period? And I thought I had learned something during all my years studying linguistics and grammar.
BTW, newsflash: many languages use semi-colons inside sentences. Spanish for example, which could be argued to be older than English. So did Erlang copy Knuth, or Erlang actually copied El Cid Campeador? I think Erlang comes from El Cantar del Cid.
Semicolon has two uses in English. First, to separate two related sentences in a way weaker than a period. Second, in place of commas separating items in a list where at least one list item contains commas.
It's a poor mind that can only conceive of two uses for a punctuation mark. Sure, those are the two conventional uses for semicolons, but it's far from all the ways a semicolon can be used. Try combining it with reported speech; consider deploying it in lists which don't contain commas (like this one); use it to jam together sentence fragments in poetry; use it to notate interruption in a screenplay; use it to make your smileys wink ;)...
With "verbose syntax" F# (just like OCaml) uses ";" as a generic separator and ";;" for ending top-level definitions. It uses "." for attribute (of modules, objects...) selection.
For me what's striking about Erlang syntax is the meaning of the semi-colon and the period, as function clause separator. Most of the rest is just vanilla FP lang syntax.
Yup, and still people get confused at Erlang's use of semi-colons and periods.
Do you think it is because other programming languages don't uses the semi-colon that way? Or that periods are usually used to access class members, but not to finish function declarations?
I think this is true. Anecdotally, I've looked up the usage of semicolons a few times now, and I think I know how to use them, but every time I'm about to I just rephrase what I'm saying so I don't have to. They are used so rarely in English it's hard to feel confident through exposure.
I use semicolons all the time; they are easy and useful.
The two clauses separated by a semicolon are sentences; thus the semicolon is logically and grammatically equivalent to a full stop. (As long as you normalise the capitalisation). The difference is in nuance, flow, and other soft things.
So when do you use a semicolon instead of a full stop? Whenever you want to!
The really difficult punctuation mark in English is the full colon.
Sure, which is what the rules always say, and is fairly straightforward. The hard part is actually using it because it usually looks so out of place to me. It's a chicken and egg problem, where semicolons are hard to comfortably use because they are so rare they look out of place when I try, and I assume part of the reason for their rarity is other people feel the same way.
I feel like the semicolon-period thing of Erlang is only really frustrating for the first day you're using it. After that, I actually found it to be a fairly natural syntax, and had little trouble switching between it and JS.
Erlang's usage of commas, semi-colons and periods is based on Prolog's use of these punctuation-marks. (Erlang was developed in Prolog and retains many similarities to it).
With haskell it will be less similar since Haskell doesn't use the semi-colon to separate function clauses, and the period for delimit the last one. You could argue that Haskell tuples will use the () syntax instead of {} as in Erlang.
I've mostly wrote this joke since many Erlang beginners find the semi-colon/period syntax confusing, but then there you have it on an essential book about programming
Any text that defines piecewise functions is going to use syntax similar to Knuth. It's much older than him or his text. Piecewise functions are not common in the normal math track though, because they're not continuous and differentiable, so they make the path to calculus more complex.
In my experience, it is we programmers who care about syntax the most. Math folks seem to be happy if you can get the gist of something.
Still, you're right, the semicolon/period thing is troubling for Erlang beginners, but that part of the syntax really does come from Prolog.
How are piece wise functions NOT covered in normal math tracks? While not strictly necessary for algebra and geometry, I can't imaging being able to grok behavior at asymptotes in calculus and analysis without being somewhat comfortable with them. They were taught in middle/early high school in Maryland school systems, if I recall.
> There's no such thing as "being good at math". You either put effort and practice to learn it, or you don't.
I agree with your second sentence, and, as a mathematician and a teacher, I think that I agree with the spirit of the first, but I think that it's probably not worded as you mean. Think of the same sentence with, say, 'baseball' in place of 'math': I think that most people would agree with the second sentence, but not the first. By the same token, there's no such thing as "being inherently good" (or, for that matter, inherently bad) "at math"; but I think that it would be silly to pretend that the effort and practice don't make you good (or at least better) at it.
The thing about the beginning of Vol 1 of TAOCP is that it begins with the "mathematical preliminaries" which is among the most difficult things in the book (aside from some of the more hard-core analysis). Like, his description of heap-sort in Vol 3. is easy enough to follow, but fuck man, generating functions are hard!
Which is why my professor and classmate and I switched to Concrete Mathematics about halfway through working through chapter 1. More thorough examination of many of the topics in chapter 1, plus more material.
My advisor would always make a joke to his classes, when that book came up, that it had a dual purpose name - - that it was foundational, but also because it's hard as concrete. I used it as reference in some of my math classes but haven't given it a thorough read.
We worked through about 1/3 of the material starting one summer term (where we started on TAOCP) and finishing sometime in the fall. Definitely hard, but it also helped me finally understand a lot of math that I "knew" but hadn't yet grokked.