Script# compiles C# source code into JavaScript - <AUTHOR> http://projects.nikhilk.net/ScriptSharp/

<comment><USER2> "Script# brings productivity to Ajax and JavaScript development."

The biggest lever in bringing productivity to Ajax and Javascript development would be for Microsoft to follow standards closer. IE8 is progress, but it's really too late to offset the losses developers have had in dealing with previously versions.

"Script# empowers you with a development methodology that brings software engineering and long term maintainability of your Ajax applications and frameworks."

No tool or language is a silverbullet for software engineering and maintainability problems. These only come with diligence, foresight, and experience.

</comment><comment><USER3> Sounds like Microsoft's version of GWT (<http://code.google.com/webtoolkit/>) only with C# instead of Java. I've just never understood why people find JavaScript so bad that they'd put another layer between them and what's running in the browser.</comment>


Is Hacker News potential treatment for those with Asperger Syndrome? - <AUTHOR>

More generally, it seems that social news sites would be a great way to treat people with Asperger Syndrome.<p>Voting would give immediate feedback that would help develop a theory of mind. <comment><USER2> Eh, no. Well maybe, a little, if we're talking baby steps. If you're just lurking it's not.

Disclosure: I've been diagnosed with AS by someone with lots of experience/publications in it, and I attended a group therapy thing for most a of a year weekly.

My personal advice. Read _How to Win Friends and Influence People_ , some pua books if you're interested in girls ( _The Mystery Method_ & Roosh V's _Bang_ ) and also as a way of developing a theory of mind, books on ettiquette and social skills, and evolutionary psychology books and apply what you learn. Keep what works.

Hanging out with communities more accepting of odd or rude behavior helps. Stay away from testosterone drenched ones unless you're good at, and like fighting. Personally I've found Goths, gamers and other assorted nerd groups the easiest to deal with. Despite the fact that excesive alcohol occasionally turns me into a total prick it was really helpful in developing my social skills, because my inhibitions were lower so I tried more shit.

Learn to do smalltalk. Practice turntaking in conversation. Do eye contact but don't hold gaze relentlessly, that's a dominance behaviour. Acting, comedy, and improv are good. Any social group built around a shared interest provides a way to start a conversation. Not all silences are awkward, some people are introverts. _Most people do not share your background assumptions, and you will only get good results modelling them if you keep this in mind._

Debating clubs are awesome, because you're _meant_ to rip people's ideas to shreds. We're social apes for whom talking has replaced grooming, animals. Keep it in mind.

</comment><comment><USER3> I would have said that immunity to social conditioning was the problem, rather than lack of social conditioning. Speaking from a position of extreme ignorance.

<comment><AUTHOR> I think people with Asperger Syndrome just need more obvious feedback. They don't pick up on subtle cues.</comment></comment>


The secret world of microwave networks - <AUTHOR> https://arstechnica.com/information-technology/2016/11/private-microwave-networks-financial-hft/ <comment><USER2> For anyone interested in the topic, I highly recommend Alexandre Laumonier blog - Sniper in Mahwah, especially the older articles.

[https://sniperinmahwah.wordpress.com/](https://sniperinmahwah.wordpress.com/)</comment>


Fast, auto-generated streaming JSON parsing for Android - <AUTHOR> http://instagram-engineering.tumblr.com/post/97147584853/json-parsing

<comment><USER2> Cool - if this is indeed faster than Jackson (and GSON), I would recommend writing a Retrofit converter ([https://github.com/square/retrofit/tree/master/retrofit- conv...](https://github.com/square/retrofit/tree/master/retrofit-converters)) so developers can just drop in ig-json-parser for use with Retrofit.

<comment><USER3> This is based on Jackson stream parsing, so by definition, it can't be faster than Jackson. :)

</comment></comment><comment><USER4> This looks cool, but I'm also interested in seeing if compared to GSON not just Jackson. Is the `JsonField` annotation mandatory? In most cases my variable names are the same as the field names in the JSON, which is why I love using GSON since it auto-picks up on that.

It looks kind of odd in your sample code too, it'd be nice if it could auto- try those fields, but I can see why that won't work if this is compile-time rather than at processing-time like GSON (it has no way of checking against the JSON to see if that assumption is true) -- maybe have `JsonType` take and optional parameter that enables "guess types" mode?

<comment><USER3> Hi!

I'm one of the authors of this library. The code this library emits is very similar to the json/jackson/manual serializer/deserializer in [https://github.com/eishay/jvm- serializers/wiki](https://github.com/eishay/jvm-serializers/wiki). Conveniently, GSON is benchmarked there too.

You're right, the field names could be guessed at compile time. Please feel free to submit a PR!

Thanks!

</comment></comment><comment><USER5> And look at how slow it still is. 40ms to parse json? I can do that around or under 1ms in iOS. When porting our app to android this was one of the biggest unexpected bottlenecks that really impacts performance. I don't know why android doesn't provide a native json implementation to reduce this barrier to entry.

<comment><USER6> Surely the size of the JSON payload matters for this benchmark. Just saying you can parse json in under 1 ms is somewhat meaningless unless you're comparing similar sized json documents, as well as marshalling into a user- supplied class.

<comment><USER5> And that's exactly what I'm comparing. This was the shock that came from the same data being loaded into android as ios being over an order of magnitude slower.

<comment><USER6> Interesting. What are you using for object marshalling on iOS? And which json processor are you using on your android benchmark? The referenced library?

<comment><USER5> Jackson (best performing) vs JSONKit. But Apple's is close enough as well.

</comment></comment></comment></comment></comment><comment><USER7> I've added an issue to chidley to generate these classes, in addition to the Java/JAXB classes it produces now: [https://github.com/gnewton/chidley/issues/4](https://github.com/gnewton/chidley/issues/4)

(Of course only for json generation from XML)

</comment><comment><USER8> How does this compare to loading up a String of json in an org.json.JSONObject and parsing it manually?

For some further abstraction/encapsulation, you can extend the JSONObject class and provide getters/settings for particular key/values.

<comment><USER3> The two are not really comparable since you get different results (JSONObjects are not strongly typed). You will easily be able to find workloads where one is better than the other, but in the average case, ig-json-parser will probably be faster because it's based on Jackson. (see json/jackson/manual vs json/org.json/manual on [https://github.com/eishay/jvm- serializers/wiki](https://github.com/eishay/jvm-serializers/wiki))

</comment></comment><comment><USER9> How does this compare to GSON?

<comment><USER3> Please see the comment here [https://news.ycombinator.com/item?id=8298557](https://news.ycombinator.com/item?id=8298557)</comment></comment>


Bullet-proof Human Skin - <AUTHOR> http://io9.com/5830664/this-is-bullet+proof-spider-silk-skin-+-made-from-goats-milk-yes-really

<comment><USER2> Pretty cool, but wouldn't it still severely damage your internal organs? It's not like the force of the bullet just disappears once it hits your skin.

</comment><comment><USER3> This is interesting, and might be possible. The worry is that even if you have bullet-proof skin, your bones would break and internal organs be turned to mush. but would it?

The name of the project is 2.6g 329m/s, after the mass and velocity of the bullet.

Using 1/2MV^2 to calculate the force, in Newtons (1): =(1.2)(0.0026kg)(329m/s)^2 = 140.7 kg _m/s^2 = 140.7 N

Convert to foot_pounds (lbf): (2) 1 N = 0.22481 lbf 140.7N (0.22481) = 31.6 lbf

So you body would have to dissipate 31.6 foot-pounds of force. Yes, it would loose some from friction mid-air, and your skin would dissipate some, but for the sake of argument, let's assume this is in a vacuum or some magical container, ceteris paribus. There's always the "it only takes 8 pounds of force to break a bone" but that's why you have soft tissue surrounding your bones. If it hit you in the head, you'd probably be screwed no matter what. I think this is more to be a replacement for body kevlar, not to wear as a batman cowl.

I once heard that a pro boxer can his with over 900 PSI, which would be about 30 lbf, but that's dissipated across a whole fist. Here's an article discussing that, it ranges widely (3). We need a better correlary.

So I continued to look and found a paper on bite force (4). It shows that a human can have a bite force of an average of 162 lbf. And specifically the incisors had a range of 22.5-33.7 lbf. That is roughly equivalent to the 31.6 lbf of a bullet. But what does this mean? A strong bite can ravage tissue, and a hollowpoint bullet would be a pretty sharp point and would likely slice right through the underlying tissue if it broke the skin (as it was designed to do).

I think it's important to look at other properties of the "pseudoskin" layer. They used a small little patch on ballistics gel, and at the end of the video the patch was pushed into the gel and folded in on itself. So if you'd been wearing the patch and got shot it would be embedded 2 inches into your epidermis and underlying tissue (but at least it would be easy to pull the slug out!).

I would think we'd need to see more info on the shear-thickening properties of the gel, see what more than just a "patch" would do; say, ballistics gel with a complete outer layer of the pseudo-skin, and other properties. The little patch has no way to grab onto the surrounding skin and provide tension to dissipate the force across the surface of the tissue (think like springs on a trampoline). And significant shear thickening would cause the pseudoskin to instantaneously harden with the force of the bullet, protecting the underlying real skin and tissue.

Need more info, but this could actually be promising.

(Note: Can someone check my calculations? I did them REALLY quickly. I can't confirm their reliability.)

Sources: 1: <http://en.wikipedia.org/wiki/Physics_of_firearms#Force> 2: <http://en.wikipedia.org/wiki/Newton_(unit)> 3: <http://www.connectsavannah.com/news/article/102548/> 4: <http://www.glapbta.com/BFBP.pdf></comment>


Idaho legislators approve law requiring transparency for risk assessment tools - <AUTHOR> https://www.muckrock.com/news/archives/2019/mar/26/algorithms-idaho-bill-update/ <comment><USER2> This is lawyer trickery. Do not think that this transparency law is meant to ensure fair justice, expect the opposite. This is the equivalent of the common "open file" rule of prosecutors. Rather than sift through and release relevant material to defendants (aka Brady material) most prosecutors just declare their files open for inspection. It is then on the defense to do the sifting, to slog through the growing pile of irrelevant material. So too with this law. Rather than properly manage the system, this is the legislature throwing its hands in the air. The burden will now be on defendants to become AI experts prior to making challenges to this system. The poor defendant seeking bail will have to point our the flaws in the code.

<comment><USER3> You make a valid point that this places additional burdens on defense. However, I feel like such openness is still better than allowing prosecutors to cherry-pick information to provide, or "accidentally" leave out a chunk of data, or require repeated specific motions to request each detail as the defense becomes aware of it.

<comment><USER4> One benefit of the "old" way is that if the prosecution omits evidence, it can be grounds for an appeal. If the defense skips something, there's no grounds and they're just out of luck.

</comment></comment></comment><comment><AUTHOR> Note: the law was passed by both legislative chambers in March, and was then signed by the governor on March 28th, to go into effect in July 2019:

[https://legislature.idaho.gov/sessioninfo/2019/legislation/h...](https://legislature.idaho.gov/sessioninfo/2019/legislation/h0118/)

</comment><comment><USER5> > _It is also the first to set requirements for public access to the design > and data used to build the tool's predictions, requiring that records > created during a risk assessment tool's development, validation, and use to > "be open to public inspection, auditing, and testing."..._

Now these are the kinds of laws we need! This is the sort of thing we should be doing all across the US for a lot of software being used, allegedly, "in the public interest".

</comment><comment><USER6> I'm surprised this didn't make any local news here in Idaho. And such an openness requirement seems at odds for Idaho's usual politics (cf. Idaho's Ag Gag laws).

<comment><USER7> The only coverage I saw was from Nathan Brown at the Idaho Press.

[https://www.idahopress.com/eyeonboise/bill-to-regulate- bail-...](https://www.idahopress.com/eyeonboise/bill-to-regulate-bail- algorithms-survives-but-likely-to- be/article_cc42a1ff-8c8f-5e2c-abb5-3905be3b4626.html)

<comment><USER8> This is why they happily get my subscription dollars every month.

</comment></comment></comment><comment><USER9> this is the exact thing that Rule Lists can do as proven by Cynthia Rudin and her team show [https://www.youtube.com/watch?v=MjxcwKN2dXs](https://www.youtube.com/watch?v=MjxcwKN2dXs) and [https://today.duke.edu/2017/07/opening-lid-criminal- sentenci...](https://today.duke.edu/2017/07/opening-lid-criminal-sentencing- software) She also has an open source code for the rule lists here [https://users.cs.duke.edu/~cynthia/code.html](https://users.cs.duke.edu/~cynthia/code.html)

</comment><comment><USER10> Isn't this rather difficult? I thought tracking back an output of something like a neural net to the salient input features was a non-trivial process.</comment>


Pentagon Scientists: We Can't Predict Violent Outbursts. Yet. - <AUTHOR> http://www.wired.com/dangerroom/2012/10/predict-violence/ <comment><USER2> _The DSB task force report outlines what it calls a "stress response curve," where performance is plotted on a graph against stress. As stress increases so does individual performance – believe it or not but people actually do perform better under pressure – up to a point._

This sounds like PTSD. It sounds like Shell Shock. It sounds like burnout. It sounds like when somebody _snaps_.

Why do we need military science to tell us what psychological science has been telling us for decades?</comment>


A map of all water in the Solar system - <AUTHOR> http://io9.com/5827649/a-map-of-all-the-water-in-the-solar-system

<comment><USER2> This is a terrible infographic. Evidence of a liquid ocean on Neptune is not evidence of water. The pictures of moons tell us precious little. The choice of shades of colour is bizarre, and the impression I get is that there's water everywhere, which may (or may not) be true, but not really an idea of form.

</comment><comment><USER3> I appreciate the illustrating the scale difference between the outer planets and the inner four, but then why is Sol soooo tiny? Made me chuckle, actually.

</comment><comment><USER4> Uh, aren't the rings of Saturn almost entirely water ice?

<comment><USER5> And it also leaves out all the Kupier Belt and Oort Cloud objects made of ice.

</comment></comment><comment><USER6> The star our planet orbits is called Sun in English. Sol is Latin. The rest of the infographic is in English. Why this inconsistency?

<comment><USER3> That's not the inconsistency; Earth and Moon are in English, all the other celestial bodies are labeled in Latin.</comment></comment>


Twitter RSS - <AUTHOR> http://www.twitter-rss.com/

<comment><USER3> The still working Twitter RSS: [http://api.twitter.com/1/statuses/user_timeline.rss?screen_n...](http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=username)

<comment><USER4> I do not use Twitter, but I subscribe to handful of Twitter handle via RSS using the above method. Works like a charm.

<comment><USER5> I believe the official RSS feeds (along with all other unauthenticated endpoints) are going away imminently.

</comment></comment></comment><comment><USER6> Wonder how long before this is blocked by Twitter. Probably not very.

</comment><comment><USER7> Thanks for pushing out such a site, really interesting and useful.

Couple of things,

\- Seems you are violating their TOS <https://twitter.com/logo#naming>

> In March 2013 Twitter will shut down the RSS feed - that's > a fact! - <USER2> > reason why we created this free RSS service.

\- As of April 13 (today), it seems RSS is still working on the Twitter API, [https://api.twitter.com/1/statuses/user_timeline.rss?screen_...](https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=brennhak)

\- Finding something on Twitter and RSS/ATOM shutdown despite searching for some time yielded nothing.

<comment><USER8> They started doing "blackout tests" [1] last month and are switching it off completely on May 7 [2]. (The public RSS feeds are a part of API v1.)

[1] <https://dev.twitter.com/blog/api-v1-retirement-update> [2] <https://dev.twitter.com/blog/api-v1-retirement-final-dates>

<comment><USER7> Thanks for the links! Very sad to see the ongoing destruction of the openness and usefulness of Twitter.

</comment></comment></comment><comment><USER9> <https://twitter.com/logo#naming>

</comment><comment><USER10> I've recently started using Twitter's own rss for Hacker News Top 150, it's very convenient.

Shameless plug: if you'd like to see all the people you follow with their single latest tweet, try my little experiment:

<http://shurcool.github.io/latest-tweets>

It works for public lists too, just write username/list. The more yellow the tweet, the more recent it is.

<comment><USER11> Tried your _shurcool_ link and the results are interesting and useful, so thanks for that. I picked up links I had missed.

However, it only shows about a hundred results (guess) and I have over 20,000 followers. Also, some entries are just the name, with no actual tweet.

<comment><USER10> Thanks.

Just to clarify, it shows your followees, as in the people you follow.

It currently shows up to 100 followees because I use a single twitter API call. Some of the tweets being empty is probably because that call is deprecated (and would have to be replaced by two calls). Given their whole API version 1 is now deprecated, replaced with auth-requiring 1.1 that would break the simplicity of the current app, I didn't spend too much effort on polishing it.

However, feel free to open an issue, if enough people +1 it, I'll try to fix it sometime. :)

</comment></comment></comment><comment><USER12> This gives RSS for a particular users' public tweets.

I'd love a service to provide an RSS feed of my timeline (would require giving auth of course)

<comment><USER13> The API for your timeline only goes so many tweets back, though. I think it's 3xxx tweets or thereabouts.

<comment><USER14> Could always use the "download an archive of my tweets" thing as an optional way to backfill.

<comment><USER13> But is it possible to expose an API for your archive containing all your most recent tweets?

It will scale in most instances, if people provide the first x,xxx tweets, though.

</comment></comment></comment></comment><comment><USER15> I was looking for such a thing tonight and ran across this AppScript trick [http://www.crossbrowser.net/290/using-friendfeed-to- automati...](http://www.crossbrowser.net/290/using-friendfeed-to- automatically-twitter-your-new-blog-posts/)

It's less likely to be blocked by Twitter because you have to register and use your own client ID. I couldn't get it to work for some reason, though.

I was installing because there are a ton of tools that rely on Twitter RSS, e.g. to auto-post to Facebook and the like. Those are broken now.

</comment><comment><USER16> They will block you for using "twitter" in the url. They own the trademark, so the name needs to be changed.... and yes, they will most definitely cancel your keys! But I like your idea! It's very cool.

</comment><comment><USER17> Better English version of your pitch line: "Get the latest tweets from your fave users in RSS."

The way it's written now is a bit awkward in English, and I can tell a native English speaker didn't write it.

</comment><comment><USER18> You should probably checkout <http://getprismatic.com/> if you want to try aggregating twitter content from your feed.

</comment><comment><USER19> Perfect! This will go well with our River of News RSS reader we launched yesterday: <http://rivered.io>

</comment><comment><USER20> This is probably an older site, given that they list Google Reader as one of the options for consuming their RSS.</comment>


Ask HN: What features would you like to see on Twitter? - <AUTHOR> Features that you terribly miss on the Twitter. <comment><USER2> A list of accounts that I haven't interacted with in a long time, so I can decide whether or not to unfollow them and keep my timeline clean of content that doesn't engage me.

<comment><AUTHOR> Thank you for the reply.</comment></comment>


The Best Books on the Philosophy of Mind - <AUTHOR> https://fivebooks.com/best-books/philosophy-mind-keith-frankish/ <comment><USER2> In the early 90's I did a short undergraduate course about the philosophy of the mind. The main text was Searle's Rediscovery of the Mind. I was never convinced by Searle's Chinese room thought experiment and I always wondered if I lacked the sophistication to understand the argument or whether the argument itself made too much of an appeal to subjective rather than objective reasoning. And so I find it interesting that Searle is not mentioned in the article.

<comment><USER3> Everyone in this thread keeps claiming that the Chinese Room argument is bad. Nobody says why.

<comment><USER4> Searle does not prove that the distinction between "actually understanding Chinese symbols" and "simulating the ability to understand Chinese symbols" is a real one. Physicalists, including me, believe this is just a confusion generated from our inside view of our consciousness, and that "really understanding" is just something a computer program thinks it can do once it gets complex enough to be conscious. At the bottom level it's still just pushing symbols around via syntactic rules (in the case of the mind, natural law).

<comment><USER5> > "really understanding" is just something a computer program thinks it can do > once it gets complex enough to be conscious.

At the same time, consciousness might not be a requisite of higher intelligence at all; it could merely have been evolutionarily advantageous early on in the development of complex brains because of our natural environment... it's hard to imagine an intelligent animal with no "me" program doing very well.

But maybe a digital intelligence (one that did not evolve having to worry about feeding itself, acquiring rare resources, mating, communicating socially, etc.) would have no use for a central "me" program that "really experiences" things.

Such a creature is kind of eerie to think about.

</comment></comment></comment></comment><comment><USER6> Pretty wild to me that David Chalmers' The Conscious Mind isn't included on this list.

<comment><USER7> Similarly, I'd put Nagel's "What It's like to be a Bat" as required reading in that group as well.

<comment><USER8> ^ Agree. This is a great paper.

</comment></comment></comment><comment><USER9> I think the most interesting and relevant strand of philosophy of mind is the connectionism of Rumelhart, McClelland and the PDP Research Group (including "godfather of deep learning" Geoff Hinton), exemplified in the tome "Parallel Distributed Processing" released in 1986

It even has an accompanying manual on how to implement artificial neural networks.

[http://www.cnbc.cmu.edu/~plaut/IntroPDP/index.html](http://www.cnbc.cmu.edu/~plaut/IntroPDP/index.html)

More along this line is found in David Marr's Vision: A Computational Investigation into the Human Representation and Processing of Visual Information

[https://www.youtube.com/watch?v=9WcIiSCDqhE](https://www.youtube.com/watch?v=9WcIiSCDqhE)

There is a spiritual successor to the PDP books called "Rethinking Innateness: A connectionist perspective on development" lead by Jeffery Elman who did some of the first research on Recurrent Neural Networks (RNNs). It makes heavy reference to Chomsky's work on language and innateness

[https://crl.ucsd.edu/~elman/Papers/book/index.shtml](https://crl.ucsd.edu/~elman/Papers/book/index.shtml)

This line of work even has heavyweight ancestors in Donald Hebb's work on the neural basis of learning in "The Organization of Behavior" (1949) and the noted austrian economist(?)/classical liberal and anti-communist Frederick Hayek covered similar lines in his book "The Sensory Order" (1952)

I think this tradition is carried on in the work of Yann Lecun, who recently released a talk titled "Deep Learning, Structure and Innate Priors"

[http://www.abigailsee.com/2018/02/21/deep-learning- structure...](http://www.abigailsee.com/2018/02/21/deep-learning-structure- and-innate-priors.html)

<comment><USER10> that would be "5 books on the philosophy of connectionism"

<comment><USER9> connectionism is an approach to the philosophy of mind, the most successful approach as evidenced by recent deep learning hype

the only book in the OP I thought was even mildly relevant was the one by Dennet, and it's generally acknowledged that it's pretty bad.

A more interesting but flawed approach, that resonates as someone who loves Dawkins and Hitchens (atheists and advocates of evolution), is Gerald Edelman's Neural Darwinism (1978). There is even modern research (that is real, working code) at the University of Texas that could be considered a successor to Edelman: NeuroEvolution of Augmenting Topologies (NEAT)

[https://www.youtube.com/watch?v=qv6UVOQ0F44](https://www.youtube.com/watch?v=qv6UVOQ0F44)

</comment></comment></comment><comment><USER11> The problem with a list like this is that each of the books - and more importantly here, the selection of the books - has a very distinct view of the problems and arguments. It's not at all objective. So in that way it may be a little misleading for neophytes to the field.

<comment><USER12> Is there ever consensus in Philosophy? The field pretty much retreated to questions where we don't have objective answers.

<comment><USER13> Philosophy teaches us that there's no such thing as objective answers. All of us are beholden to subjectivity and perspective, which means we can't reliably judge whether something is objective anyway. Consensus is moot, and I'd go so far as to say that consensus is how you get religions.

<comment><USER14> Philosophy teaches you that? How?

Most working philosophers do not hold this view. ([https://philpapers.org/surveys/results.pl](https://philpapers.org/surveys/results.pl))

<comment><USER13> First, I'm speaking for myself, not the orthodoxy. Martin Luther was 500 years ago, after all.

Second, what am I supposed to realize via that link?

</comment></comment></comment></comment></comment><comment><USER15> I never read a book about philosophy but found an answer to most philosophical questions just by thinking, discussing and occasionally wikipedia. Took a philosophy course, but it was mostly lot of vague words with questionable substance. The core ideas in philosophy could be summarized on one page with little information loss. This probably seems horribly arrogant, but that's just how I honestly see things.

<comment><USER16> Finding such an ignorant comment at the top of HN is quite disappointing.

Obviously, you are still in the first stage of competence [https://www.wikiwand.com/en/Four_stages_of_competence](https://www.wikiwand.com/en/Four_stages_of_competence) and you don't know what you don't know.

<comment><USER17> When someone tells me they know how to fly, I first ask them to show me before claiming they are full of it.

Of course philosophy has value but I too am quite disappointed how easily it enables very basic flawed assumptions to exist over eons even in what would be considered high academic levels. To me it feels like the equivalent of physicists today being divided on whether the earth revolves around the sun or vice versa.

Personally I think both Searle and Dennet are essentially dualists (though they'd both vehemently deny it), but each practicing a different form of dualism: Searle promoting some mysterious consciousness as some ghost in the machine, and Dennet protecting physicalism which in my book negates any subject from existing, in complete contradiction to the reality that any object (physical or otherwise) will always be just a model in someone's experience. I see Dennet as trying to squash dualism by giving the model more validity than the very real experience from which it arises, where the better path to eliminate dualism would be to try and get to the source of this division.

</comment></comment></comment><comment><USER18> Perhaps add 'The Mind Matters' by David Hodgson to this list. Especially interesting as the author has a pressing need for practical pragmatic guidelines to his behaviour, rather than engaging in a purely academic or abstract exercise (Australian High Court judge in New South Wales).

</comment><comment><USER19> I use this site pretty regularly to bootstrap reading about topics that I haven't much familiarity with. Even if the 5 books aren't the best, they're almost always enough so that I can direct my own continued reading. A great site for going from 0 to 1 in some topic, so to speak.

</comment><comment><USER20> "The mind is material" seems like a funny hypothesis to me, given the massive unknowns in quantum theory --- we don't even know what "material" _is_ fundamentally.

<comment><USER21> By that logic, I can't say "this brick is material" either, because we don't know what "material" is.

But really that's just arguing over words and definitions. We know what we mean when we say material (certain properties and behaviors), and as far as I know, we have just as much reason to think that a brick is material as that a mind if material. We don't need to understand literally _everything_ to be able to make predictions about how things behave.

<comment><USER20> I can show you a brick. Can you show me a mind?

<comment><USER22> This is irrelevant. You don't have to show brick every time. We say sugar is sweet. No body experience how sweet is defined by other. Still we all believe it is sweet.

<comment><USER21> That's a bit different. The definition of sweet is basically defined as "the experience you get when eating sugar". It doesn't matter for this purpose if that experience is completely different for you - all that matters is that we both know that "sweet" is basically a synonym for "your experience of sugar".

Note that this definition allows you to predict a lot of things:

1\. You can predict that you'll have the same experience when eating other things which are not sugar, but which you know cause the same experience in you.

2\. You can predict, at least in broad outlines, whether people will find this experience pleasurable or not (again, on average, broad outline, but still better than chance).

3\. You can predict that someone without a sense of taste _won 't_ experience anything when eating sugar.

That's why this definition is meaningful. Of course I can play word games all day about "can you show me 'sweet'???". But those are word games that are trying to hide the idea of what a definition is and what we use it for.

</comment></comment></comment></comment></comment><comment><USER23> That's an interesting site.</comment>


Algorithms Aren't Killing Creative Culture - <AUTHOR> http://www.psmag.com/nature-and-technology/algorithms-arent-killing-creative-culture

<comment><USER2> I'm always surprised by the fact that the antagonism between human and machines, creativity and routines are maintained in the mind of the public. All of these articles conclude somehow with some platitudes like "machines are nothing but the result on human creativity and sophisticated algorithms are nothing but the best expression of it...".

In my view, it would be a significant contribution to find a way to drive the public to understand that an algorithm have "a meaning". It predicts what people should like or buy just because someone have determined the features that should be taken into account (even if you put statistical learning to determine these features and you don't decide manually). "Algorithms have meanings"… Maybe someone talented should write about that!</comment>


Ads/CFT correspondence: the fountain of quantum youth - <AUTHOR> https://arxiv.org/abs/2003.09228 <comment><AUTHOR> Entangled particles do not experience the flow of time</comment>


How Andreessen Horowitz Is Disrupting Silicon Valley - <AUTHOR> https://medium.com/@petersimsie/how-andreessen-horowitz-is-disrupting-silicon-valley-208041d6375d <comment><USER2> I'll be honest -- my first impression after reading this piece was to research Peter Sims and figure out his connection to a16z, since my gut reaction was that blatant puff pieces usually have some sort of connection hidden below the surface. (I was unable to find anything.)

Sims brings up the following point about VC returns:

 _> The predominant old way of thinking about venture capital is that you: a) build up a great brand and reputation with a large portfolio of investments, b) hire partners who have individually strong brands of their own, and c) collect hefty management fees on each fund. The industry standard is a 2–2.5% yearly "management" fee, a figure that gets pretty large on a billion dollar fund. And, in my experience, not surprisingly, the senior people get a disproportionate slice of that management fee. At the same time, the venture capital industry has been a glaringly poor-performing asset management group, consistently underperforming the S&P 500. (For more detail on the struggles within the VC industry, a recent article on the Harvard Business Review Blog by Diane Mulcahy, a senior fellow at the Kauffman Foundation, entitled "Venture Capitalists Get Paid Well to Lose Money" is well worth reading)._

But never swings back around to it (unless I missed it amongst the flowery prose). Which leads me to ask: are there data points that compares a16z (or other VC firms!) against the S&P 500, besides the aggregate?

<comment><USER3> I have data that compares other VC firms to the S&P 500. Give me a few minutes and I'll find it. Foreshadowing: it's pretty bad, you'd do much better putting your money in an index of the S&P 500.

<comment><USER3> Found it: [http://www.kauffman.org/~/media/kauffman_org/research%20repo...](http://www.kauffman.org/~/media/kauffman_org/research%20reports%20and%20covers/2012/05/we%20have%20met%20the%20enemy%20and%20he%20is%20us\(1\).pdf)

The title is "We Have Met The Enemy...And He Is Us": Lessons from 20 years of the Kauffman Foundation's Investments in Venture Capital Funds.

<comment><USER4> That's a great paper but most people are interested in the performance of the top 10 firms, not the average of the top 100. If I invest only in Sequoia/KPCB/AZ/Accel how well am I doing?

<comment><USER5> You should be able to get return information from State Pension Funds that invest in private equity/venture capital.

For example, the Washington State Investment Board Private Equity IRR report can be access at [http://www.sib.wa.gov/financial/invrep_ir.asp](http://www.sib.wa.gov/financial/invrep_ir.asp). From December 2013 IRR Report [PDF] at [http://www.sib.wa.gov/financial/pdfs/quarterly/ir123113.pdf](http://www.sib.wa.gov/financial/pdfs/quarterly/ir123113.pdf),

        U.S. Venture Partners VIII, L.P.     6/4/2001     3.23%
        New Enterprise Associates 10, L.P.     10/17/2000     3.16%
        Menlo Ventures X, L.P.     1/6/2006    0.66%

<comment><USER4> That's great, thanks. Unfortunately it doesn't have much post 2001 data on many big name VC funds like Sequoia/Accel/KPCB.

Reuters couldn't get these via Calpers after suing.

[http://www.reuters.com/article/2013/12/20/us-funds- californi...](http://www.reuters.com/article/2013/12/20/us-funds-california- ucal-idUSBRE9BJ04I20131220)

</comment></comment></comment></comment></comment></comment><comment><USER6> That made me ill. I'm sure a16z is great and all, but there wasn't even a hint of criticism there. They couldn't find one slightly pejorative anecdote to contrast with the endless amount of fawning? I had to double check the byline, because by the end of it, I was convinced it had to be written by Robin Leach. Champagne wishes...

<comment><USER7> I agree. It's also worrisome that Marc Andreessen predicts the future so much lately. The future simply can't be predicted with such reliability as his certainty implies.

<comment><USER8> Strong opinions, weakly held.

[http://blog.codinghorror.com/strong-opinions-weakly- held/](http://blog.codinghorror.com/strong-opinions-weakly-held/)

</comment></comment></comment><comment><USER9> Andreesen Horowitz became the apple of every startup founder's eye because they were the new guys who had success as investors while being friendly to startups

I'd rather raise money from a guy who wears a 'No Bitchassness' [0] shirt who wants to pump up my valuation, help me recruit tech talent, and allow me to give equity to compensate my best people versus some stodgy old guy who thinks he's better than everyone because he invested in [insert successful company from the 90s/early 2000s].

Basically, they were the uber of VCs in terms of how they treated their portfolio companies.

That said, I generally don't like media that praises investors because once we start glorifying the fund-raising process rather than bootstrapping and making money, we'll have tons of companies with too much money and no exit. Bubble burst.

0: [http://www.jasonshen.com/wp- content/uploads/2012/10/benhorow...](http://www.jasonshen.com/wp- content/uploads/2012/10/benhorowitz-150x150.png)

</comment><comment><USER10> AH is doing some remarkable stuff.

1) Like any great knowledge based firm - which strives to differentiate over and above its people - they have invested in tools. While the inspiration maybe CAA, firms like Mckinsey (knowledge management system) and Goldman (SecDB / Slang on the trading side and a detailed CRM system for the banking side) used the software / infra layer to develop a sustainable advantage which did not just depend on hiring the "smartest people" I.e. if people quit Goldman / Mckinsey - suddenly they were not able to outperform. On wall street - they call it seat value (how much value are you adding versus the seat/organization)

2) As a complete outsider - one can still easily see how the CRM software + sales connectors capability translates to $$$ for portfolio companies. For e.g. Box's recent deal with GE.

3) Therefore, on the enterprise side , if AH acts like a sales force (led by Mark Cranney) - then how does an enterprise company that is not backed by AH compete? In other words, over and above the prestige factor of being backed by a top tier VC firm- will NOT raising money from AH in the enterprise side put you at a disadvantage?

4) How much of this sales force / business development muscle applies to the consumer side? AH partners have referred to consumer startups as fruit fly experiments and will invest with a strong offer post-traction/ series B? But is there value in the consumer side as well in BD deals like how Moritz/Doerr helped Google power yahoo search and collect valuable search engine user behavior which was used to refine and test thier algorithms.

5) The article did mention in passing about recruiting support. But - I have read about a detailed software + people capability on talent hiring.

6) So, if sales + recruiting + strategy/advise are three value adds by VC firms (not counting money!) - does AH have a lock on 2 of the three?

<comment><USER3> Right, but the real question is: what are their returns? (And: how do they compare to VC as a whole?, how do they compare to long-term US treasury bonds?, how do they compare to the S&P 500?

<comment><USER11> As linked, AH's first fund had an IRR in the 30% range for 3 years which blows away pretty much every other asset class. I'm sure Accel, Founders, Sequoia, Benchmark, etc are doing even better.

You can't look at venture averages because the best firms are easy to identify and perform much better than average.

<comment><USER12> Three years is a very short timespan from which to make claims about asset classes. In most cases, seven years is considered the minimum for a true sampling of baseline performance; ten years is better, and more than ten is better still. Obviously a16z hasn't been around for ten years, so metrics like three-year IRR are the best we have. That said, it's silly to take a three- year IRR and benchmark that confidently against something like the S&P 500.

On the other hand, I would strongly suspect that the top VC firms massively outperform the VC industry as a whole, due to any number of factors, including deal access, ability to secure favorable terms, ability to make new rounds or exits happen, etc. In time, a16z's longitudinal performance may well beat the market. But it's way too early to call the ball.

I agree that you can't really look at the aggregate performance of the entire VC industry. It's probably a highly skewed distribution, with almost all the big returns going to a handful of funds.

</comment></comment></comment></comment><comment><USER13> What would be the (software) VC equivalent of contrarian investing?

Let's see, we could invest in companies that

\- are tackling problems for which solutions already exist

\- are staffed by experienced people, not youth

\- use mature technology

\- have nothing to do with the web or even the internet

\- are run outside of the valley (bonus points for flyover country)

Surely there must be other things that warm the heart of the contrarian investor?

<comment><USER11> I don't think the geography is the best parameter. Think of it this way: if something was contrarian in all other aspects, would you prefer it in the Valley or outside? Can you say that about other parameters?

<comment><USER13> Contrarian investors try to do what most investors don't. Don't most VCs invest primarily in companies that are nearby, meaning Silicon Valley proper and maybe the larger peninsula? Which means a contrarian would invest outside it. Maybe way outside it. Like Kansas.

<comment><USER11> Well, I was just trying to explain why that might not need to be the case. You can be contrarian and focus on the Bay Area. And that in fact might be smarter.

</comment></comment></comment></comment><comment><USER14> Just a reminder, Andreessen is the same person that says Snowden is a traitor.

<comment><USER15> And from reading some books discussing Andreessen & his past ventures I wouldn't have thought he'd have considered Snowden anything other than a +ve force in the information world.

Perhaps Andreessen has interests in companies that were hoping to help governments spy on their charges?

<comment><USER16> Or maybe he just happens to believe what he says? Maybe he believes that the sensitive information that Snowden released is damaging the security of the US?

I personally think Snowden was a traitor. He released way more information than was necessary to accomplish his goal; The information he released has almost certainly put lives in jeopardy; AND he fled to Russia which is essentially a totalitarian state where his presence, if not aiding in a material way, is aiding Russia in a PR capacity. If you haven't noticed, Russia is turning out to be, if not a geopolitical foe, and outright enemy of the United States.

Why have we got to jump to questioning people's motivations every time they stray from the party line? ...As if there is only one acceptable opinion to hold on everything.

Sheesh

<comment><USER14> The _only_ comment he made were to blame Snowden and brush off the massive surveillance and obstruction of civil liberties without a word. So rather than consider the problem that created Snowden he only blames the messenger. I can't think of a single character from the past year, be they pro or con, that commented on the topic in a more pathetic way.

</comment></comment></comment></comment><comment><USER17> I wasn't aware of all the great stuff AH is doing. It looks impressive.

They're not the only VC firm innovating, though. First Round Capital, for example, also has a terrific recruiting division (I know this is common at other firms as well). FRC also created the Dorm Room Fund[0], which invests small amounts in student-run companies and gives them access to FRC resources. FRC has an internal "platform team", developing technology to enable knowledge sharing between portfolio firms. In short, they work hard and do new things to help entrepreneurs succeed.

I'm speaking about First Round because I have direct experience with them, but I'm sure the same is true of some of the other VC's as well.

[0] dormroomfund.com - disclaimer, my former startup received funding from them.

</comment><comment><USER18> The word "disrupt" has become entirely meaningless, hasn't it?

<comment><USER19> I agree, just install this: [https://chrome.google.com/webstore/detail/disrupt-to- bullshi...](https://chrome.google.com/webstore/detail/disrupt-to- bullshit/mahaemfhlcjficbbkbpmkbhhenfnikcf?hl=en)

</comment></comment><comment><USER20> I couldn't get more than a quarter of the way through. Is it all gushingly sycophantic?

</comment><comment><USER21> It seems really odd to have such an powerful part of the Silicon Valley establishment accused of disrupting anything. Unless there's some aspect to their business model that differes from venture capital in the most traditional sense, and that I am missing.

</comment><comment><USER22> It was an interesting Editorial Decision to not use the preferred A16Z, but instead go with the (exactly same length) A.H. everywhere.

<comment><USER23> A.H. requires no explanation for those not in the know, A16Z does.

<comment><USER22> Right - but linking their company's abbreviation to the software development concept of I18N, would have been a great introductory paragraph, that picked up on the essential geekiness of Ben and Marc. It's

</comment></comment></comment><comment><USER24> =~ s/Disrupting/Leading/

</comment><comment><USER25> It strikes me as ironic that he would pick Twitter to convey >140 char essays.

<comment><USER26> Especially as a board member of Facebook.

</comment></comment><comment><USER27> Andreessen Horowitz has generated a positive reputation (in a field where most of its counterparts are ridiculous, incompetent assholes, so seeming strongly competent provides prominence) but here's a stark indicator for "wolf in sheep's clothing": [http://a16z.com/2014/07/30/the-happy-demise-of- the-10x-engin...](http://a16z.com/2014/07/30/the-happy-demise-of- the-10x-engineer/) . Read it.

If you don't have a nose for rot, I'll point your way to it:

        Today, if you have a great idea for a software product, you need to either
        be an engineer or find one. Tomorrow, that billion-dollar startup acquisition
        might not need an engineer at all.

I have no direct knowledge of A16Z, but admitting a desire to make software "a low-skill trade" is chewing our food for us. The moral conclusion is right there. They've actually admitted to being the bad guys, to wanting to commoditize top talent in favor of our MBA-culture colonizers.

Most of the time, the bad guys don't say, "We're the bad guys". You actually have to do some research. You have to poke around the countryside and find the emaciated political prisoners and the mass graves to figure out who the bad guys are. Not here. The good news is that the Silicon Valley elite have such unprecedented arrogance that, often times, they'll actually admit what they are. They'll flat out say, "fuck you programmers, you had your turn."

For those who aren't educated on the matter, the evil of Silicon Valley's last 20 years is that it has become an economy of resource extraction (like Saudi Arabia) instead of one that genuinely creates wealth. The difference is that, instead of said resource being oil or natural gas, it's the intelligence and energy of each generation of young people that hasn't figured out, yet, that the only people with a decent chance of getting rich in this Valley game are VCs and landlords (i.e. not them, the people doing the actual work).

<comment><USER28> Your acting just like the old factory worker who's pissed that his profession is starting to become more automated. Wake up and smell the coffee, developers are getting more productive and you have to adapt to the decreasing demand that this will cause. Programming is job in the labor market just like a fast food cooker. If you want to make some more money, either learn some skills that most other people do not have and that are needed (low supply, high demand), or start a company so that you can make some profits (which technically have no limit).

BTW, I think you need to look at the salaries of some other professions. I'm gonna be making 6 figures out of college as an SDE, while most of my engineering and business friends are going to be making about half of that. Talk to non engineering/business majors (cough, communication majors, cough) and the pay gets even worse.</comment></comment>


Sweatshop HD is the latest victim in Apple's war on serious games - <AUTHOR> http://www.pocketgamer.co.uk/r/iPad/Sweatshop+HD/news.asp?c=49468#

<comment><USER2> I can understand why it was pulled. The whole thing smells tacky. Make your political statement elsewhere.

They would have pulled GTA as well if it was called GTA: Hooker Drive-by!

Or Stripper Ville.</comment>


The Fastest Google Fonts - <AUTHOR> https://csswizardry.com/2020/05/the-fastest-google-fonts/ <comment><USER2> Just use the built-in fonts. Use a good fallback list so each platform gets a good option. Specifying custom fonts is largely a waste of bandwidth for a very marginal improvement in aesthetic. The people who care most are the ones making the decision to use that font. The solution, tritely, is they should stop caring about the little details that much.

The bigger details are usually what move the needle. Don't get stuck optimizing a local maxima, which is very easy to do if you're using AB tests. Arguably the point of an AB test is to find the local maxima, but the goal should be to broaden the search space and look for something closer to the global maxima.

<comment><USER3> There seems to be a reply like this at the top of every font-related thread on HN. I often wonder whether it's coming from designer/developers or from end users.

Web fonts aren't popular just because they're pretty. They continue to be used everywhere because they offer a consistency that's impossible to get otherwise. With a plethora of mobile devices and desktop environments, you can't get a consistent look-and-feel for a site with just installed fonts. For some really basic sites, that's totally okay and even hits a nice quaint aesthetic, but for the kinds of sites that people pay money for, that's not good enough.

Variability in system fonts means that getting consistent paragraph and header widths and spacing is impossible. It means that the text looks too dark sometimes and too light other times. It means that the font appears unreadably small sometimes and obnoxiously large other times. It means having to build a font stack and then keep it updated as preinstalled fonts change. It means spending a lot of time dealing with issues like Helvetica Neue looking okay on MacOS but rendering like ass on somebody else's desktop because they installed a free knock-off of it. It ultimately introduces a lot more complexity and fragility than properly using a locally-hosted web font.

<comment><USER4> You said it yourself: Users are viewing your site on devices with totally different screen sizes, different resolutions, on different platforms, with displays of varying brightnesses, glare, viewing angles, color spaces, and in environments of varying levels of lighting. Given these constraints, it's not possible to get a consistent look-and-feel.

So don't waste resources trying. You'll create more problems than you'll solve.

Nobody tests their web fonts as thoroughly as the default fonts have been tested on their respective platforms and devices. Web fonts can have odd platform-specific bugs with kerning, hinting, and subpixel rendering. I've had web fonts render without hinting on Edge, but look fine on Chrome & IE on the same system. How does one even begin to write automated tests that detect issues like that? Using the default fonts guarantees you'll never have to worry about such bugs.

The system's installed fonts are guaranteed to work. They improve performance. They prevent re-flows. And they're what the user is accustomed to. These reasons and more are why Facebook, Github, Twitter, Wordpress, and many others use the system fonts.

<comment><USER5> But it is possible to get a consistent look and feel for fonts, by using web fonts.

<comment><USER4> If by "consistent" you mean "looks like garbage on some platforms", then yes, it's possible: [https://medium.com/@ValidScience/two-mysterious-web-font- bug...](https://medium.com/@ValidScience/two-mysterious-web-font-bugs-that-no- one-seems-to-be-talking-about-861022e7fe69)

Web font bugs show up in the weirdest places. Unless you're constantly vigilant and manually test across all the platforms you want to support, some users will see crappy fonts. Hardly anybody goes looking for these bugs, so the bad fonts can be shipped in production for years without anybody at the company noticing. This is what has happened at Apple, Wired, and Medium.

Not that consistency is worth striving for. There's not much consistent about what you can show on both a 6" 4K OLED and a 15" 1366x768 TFT LCD. Certain fonts will look great on the former and be borderline-unreadable on the latter.

<comment><USER5> The first one is, just like it says, a bug, and apparently a bug that Apple fixed on their website. The second one is Wired using a terrible web font. Neither the possibility of having fixable bugs nor the option of choosing a terrible font strike me as particularly strong arguments against web fonts. You are already free to use system fonts at terrible sizes or contrast ratios, and many sites definitely do that.

<comment><USER6> I'm the author of that Medium article. The "second one" you referred to isn't the second bug I reported – it's just an aside on Wired's crazy headline font. They've since replaced it with a normal readable font...

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> > It's widely accepted that self-hosted fonts are the fastest option: same > origin means reduced network negotiation, predictable URLs mean we can > preload, self-hosted means we can set our own cache-control directives, and > full ownership mitigates the risks that come with leaving static assets on > third-party origins.

This is my general approach now. Feels like a lot of work to keep up with what the ideal remote loading snippet is when local hosting can be simpler and the fastest option. The deep dive into how all the approaches compare is really interesting though.

It's frustrating web developers still need to deal with this complexity just to load a font. I don't think most non-frontend developers realise how much effort it takes to make a nontrivial high performance website. Most of the time in frontend there's many ways to do the same thing, each with their own subtle performance tradeoffs.

<comment><USER8> This is my approach too. For logo/slogan fonts, one can go ahead even subset the font.

It's probably a good idea to refresh the fonts off Google once or twice a year though. Although not often, these font file get updated.

<comment><USER7> > For logo/slogan fonts, one can go ahead even subset the font.

SVG is a nice option for logos. You can inline the SVG file directly into the HTML as well so there's no loading delay - especially useful for logos that need to be rendered immediately at the top of the page.

</comment></comment></comment><comment> ezequiel-garzon Would it bloat Chrome significantly if Google included their web fonts in the browser? And, you know... the other browsers can actually download them? I know it doesn't seem like fair play, but... I'm surprised they haven't done it yet.

<comment><USER9> Can't track the usage this way, though.

<comment><USER10> Sure they can, just get Chrome to notify Google whenever a site uses one of the pre-downloaded webfonts.

Chrome is pretty chatty with Google; you probably wouldn't notice the extra traffic from these notifications.

</comment></comment></comment><comment><USER11> On allaboutberlin.com, I serve Google Fonts locally. Aside from the benefits mentioned in the article, it also makes HTTP2 server push possible. This means the font is pushed along with the page, without first having to parse the HTML and the CSS. It's significantly faster. There are fewer server round trips.

The website loads from start to finish in 200ms on my end (in Berlin of course). At this point, DNS and server distancs are bigger issues than what's on the page. I find the call for system fonts rather funny, because it's such a pointless sacrifice.

Another significant benefit is privacy. I don't like sending visitor information to third parties. I removed Google Fonts requests, and I'm working on removing Analytics. Once this is done, there won't be any third party requests on the page.

<comment><USER12> I also removed yesterday the Google Fonts import and just imported them locally. Performance seemed the same in my case, but I finally managed to completely remove Google 3rd party scripts from my site (no more GA, Google Fonts or Google Tag Manager). The only 3rd party left in my case is the chat widget from Tawk.to, but I will soon replace it with a simple contact form, as I am only using it as one anyway.

</comment></comment><comment><USER13> It's better to block web fonts with uBlock Origin. It would be sweet if someone could add support for these fonts to Decentraleyes as well, which seems to be missing. Seems to be some debate about the merits of doing so, however: [https://github.com/Synzvato/decentraleyes/issues/34](https://github.com/Synzvato/decentraleyes/issues/34)

I'm okay with 1st party usage, but I don't want Google following me around the web.

<comment><USER14> I wonder if Mozilla or DDG or some other privacy centric org might consider mirroring Google's fonts.

<comment><USER15> Cloudflare should do this. They already have the infrastructure and they have a pretty good privacy reputation.

<comment><USER16> Mozilla (and Chromium) could mirror Top X Google Fonts directly into the user's font system and entirely eliminate remote calls for a small size increase in the browser installation.

(Or Microsoft and Apple could do it in OS images.)

You can do it yourself, even, but unfortunately font loading timings are a deanonymization vector with its own privacy implications and it would take a concerted group effort to install similar font sets locally to avoid those privacy issues.

<comment><USER15> That would be an interesting concept. I like the idea of including them in Windows and macOS.

</comment></comment></comment></comment></comment><comment><USER17> I do like that now Google lets you downloads the fonts, so you can serve from your own CDN without having to hunt them down or download them manually from their CDN endpoint. One thing I'd like to see Google do is add icon font sets to their repo.

<comment><USER18> They've always all been open, and you've always been able to get them. [https://github.com/google/fonts](https://github.com/google/fonts)

<comment><USER19> Oh nice. I've always downloaded from the fonts website, I had no idea they had them hosted on GitHub, that's useful. Thanks.

</comment></comment></comment><comment><USER20> This page opens crazy fast (at least for me). Well done.

EDIT: Okay, still a few things they could improve on ([https://gtmetrix.com/reports/csswizardry.com/N9gkLyhq](https://gtmetrix.com/reports/csswizardry.com/N9gkLyhq))

<comment><USER21> The main content may load quickly, at least with javascript disabled, and that's a good thing; but I can hardly read the text though. 300 weight text at 51% grey is awful.

When I see pages formatted like this, I tend to make a decision between opening the inspector and fixing the fonts, or just not bothering to read it, since it's clearly not designed to be read.

Original: [https://qui.suis.je/drop/faster/illegible.png](https://qui.suis.je/drop/faster/illegible.png)

400 weight: [https://qui.suis.je/drop/faster/better.png](https://qui.suis.je/drop/faster/better.png)

400 weight and black: [https://qui.suis.je/drop/faster/black.png](https://qui.suis.je/drop/faster/black.png) (not necessarily an improvement, once the weight is normal).

<comment><USER22> Simply bumping the weight upto 400 would make the site much more readable.

<comment><USER23> About to release this fix now.

</comment></comment></comment></comment><comment><USER6> Faster still would be to skip the request for the CSS altogether by inlining it in the head. Therefore you'd just request the font immediately and directly. This makes the preconnect moot, and should be faster.

Faster still is to use already installed fonts, as others have noted. But don't use "system" fonts if that means UI fonts like San Francisco or Segue. Exploit the rich font options on the desktop: Georgia, Sitka Text (Windows 8.1+), Calibri, Hoef, etc. Bootstrap and Medium started a ridiculous fad of using system UI fonts for body text. There are actual body text fonts available people.

<comment><USER23> OP here. Inlining CSS won't work as the request is UA-sniffed.

<comment><USER24> Modern browsers are smart enough to only download the required file type, sniffing is unnecessary the vast majority of the time and you save an entire 3rd party connection.

There are tools like [https://google-webfonts- helper.herokuapp.com/fonts](https://google-webfonts- helper.herokuapp.com/fonts) which will get you the needed css.

<comment><USER23> I know how browsers work, but thanks.

The tool you linked does not solve the same problem, as the problems isn't file types but URIs. Google is able to provide the tiniest possibly font files by hinting them for the specific browser/platform requesting them. We never consistently or predictably know the resultant URI of a Google Fonts-hosted font file. Here is a Tweet to the same effect from two days ago. Believe me, I've researched this :(

[https://twitter.com/csswizardry/status/1265716520346320903](https://twitter.com/csswizardry/status/1265716520346320903)

<comment><USER24> The URLs on gstatic.com are static. I've been doing this for years in production without issues.

<comment><USER25> The fonts are static, but the CSS (from fonts.googleapis.com), and the font files it references, vary depending on the User-Agent. For instance, with a Chrome UA it will request WOFF files; with a blank UA it may request TTF files.

<comment><USER24> The idea is that you take all the links to the different font types and put them directly in your local CSS. Your browser knows which formats it supports, if you have TTF and WOFF2 fonts linked, Chrome will only download the WOFF2 version. No need to send an extra 3rd party request just to get a piece of CSS that only links a single file type.

<comment><USER25> Well yes, of course you can do that. But at that point, why would you reference third-party font URLs, instead of self-hosting them? (The article pretty much begins by stating that this is the fastest option.)

If performance is your utmost priority, forego web fonts entirely. If you value performance but want the benefit of a web font, self-host your CSS and fonts. If the convenience of Google Fonts is appealing, the suggestions here can improve first-paint performance. Different projects will have different trade-offs.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER26> I don't understand why the async stylesheet thing works:

      <link rel="stylesheet"
            href="$CSS&display=swap"
            media="print" onload="this.media='all'" />

The media query doesn't match. Why does the browser even load the stylesheet? Shouldn't it only load it if it starts to match? _Especially_ for things like print stylesheets, where the media query will only become true by deliberate user action (unlike viewport size media queries where actions like rotating a device could cause them to start matching). Print stylesheets will be used by <0.0001% of users on almost all pages, and could easily be loaded only when the user tries to print the document.

The whole thing is a dubious technique anyway because it depends on JavaScript—if JavaScript is disabled, the stylesheet will now not load _ever_. You're probably OK with that in a case like this (the fonts are deliberately optional), but inevitably with such techniques people start using them on stylesheets that actually _are_ important, because "it makes the page load faster" or something.

P.S. Why the trailing slash on the tag? It's _completely_ useless, by definition, and trailing slashes can mislead people into thinking that you can close tags that way, which you can't.

<comment><USER27> It is explained in the article how it works:

"This will implicitly tell the browser to load the CSS file in a non-blocking fashion, applying the styles only to the print context. However, the moment the file arrives, we tell the browser to apply it to all contexts, thus styling the rest of the page."

The browser ignores the file because it's just for print and can be loaded later on. But when the page is fully loaded (onload="..."), the media property is set to "all" and does not stay at "print". When this happens, the browser now knows it should load it as soon as possible and does so.

As you mentioned: if JS is disabled, the file will never load. The author states that his solution is not 100% perfect: "[Async webfonts] should always be considered an enhancement anyway, so we need to be able to cope without them; we can and should design decent fallbacks for use during their absence, and;"

<comment><USER26> You missed my point, or I didn't explain it well enough. I'm saying: why is the browser even _starting_ to load the stylesheet? It should see media=print and decide that it doesn't need it _at all_ , and only fetch and load it when the media query starts to match, or perhaps by heuristics when there's a reasonable chance that it will soon match.

As it stands, browsers are fetching print stylesheets all the time (sure, at idle priority, but they're still _fetching_ them) even though they're _used_ less than once per million page loads. This seems silly.

<comment><USER23> OP here: Simply because the only mechanism a browser needs is 'a currently- matching media type' or 'not a currently-matching media type'. There is no need to add further checks for a specific media type; that would lead to added and potentially infinite complexity as new media types are added.

<comment><USER26> "Does the media query match" is certainly the simplest way to defer loading, but I think some leeway could be useful; the user agent may have ways of predicting when there's a reasonable probability that the media query will match soon. Kinda like how  doesn't load once the image is _needed_ , but a short time before it's _probably_ needed.

Hmm, thinking about , I've thought of a reason they might not load such stylesheets lazily: privacy leak, you're notifying the server that the document may have been printed. Lazy image loading has been careful to address this situation so that it's no new surface (e.g. browsers shouldn't lazy load if JS is disabled, but if it's enabled you're not leaking anything new). But printing specifically? I guess there hasn't been any way of detecting that the document has been printed, so doing lazy loading on stylesheets for different media types would reveal something new.

<comment><USER23> You can detect print very, very easily. I helped the NHS track print-users using this: [https://csswizardry.com/2018/03/measuring-the-hard-to- measur...](https://csswizardry.com/2018/03/measuring-the-hard-to- measure/#print-stylesheets)

Note that we can't use `background-image: url();` here as browsers will not print background styles by default, so we'd likely miss the majority of cases.

<comment><USER26> Good point, I completely forgot about that vector. Then there's no privacy leak, and I go back to not being able to see why they do it the way they do! :)

</comment></comment></comment></comment></comment></comment></comment><comment><USER28> Off topic, but does anyone have a thought on what is the best unicode font? That is, a font that includes all the characters for the 30+ most use languages (including all the double byte languages)? I know every system had a default unicode font that any character can fall back to (I was surprised when I was working with Turkish and the font didn't 3 of the Turkish characters so it fell back to the system font for those three. That was the first time that I learned that text is rendered character by character and if the indicated font doesn't have that character then it will keep going through the fall backs before reaching the system font and then falling back to some default no font character found symbol), but what is the best non-system font that also covers the vast majority (by percentage of people) of modern languages?

<comment><USER8> Noto ([https://www.google.com/get/noto/](https://www.google.com/get/noto/)) is a popular font that contains glyphs for all languages. It's a gigantic 1.1 GB file.

I'm involved in fonts for my native language (Sinhalese), and let me tell you: dealing with fonts for multiple languages are is not easy! Some of the Asian languages including Sinhalese are pretty difficult to get right, and glyphs are quite difficult to give a character without breaking their meaning, specially when it comes ZWJs, diacritics, etc.

You can subset a font like Noto to serve your languages, but it will come pretty large. Note that for web, @font-face declarations can set a Unicode character range for each font file, so browser downloads those fonts only when necessary.

</comment></comment><comment><USER29> The modern bloatware web where 1.7 seconds is considered fast.

Good article though, great research effort.

<comment><USER30> > The specific profile was a Samsung Galaxy S4 over 3G.

1.7 seconds is pretty reasonable for a 7 year-old phone on 3G.

<comment><USER29> Thanks, I didn't realise that.

</comment></comment></comment><comment><USER31> ||fonts.googleapis.com^ is one of the first things I do when setting up a new browser.

</comment><comment><USER12> I use `font-display: optional` instead of `swap` as it leads to less paint flashing, and if the font is too slow to load, it's not the end of the world if it displays it with the fallback system font.

<comment><USER12> I noticed this is actually mentioned in the article at the end as a bonus section. In my case `optional` did seem to work better. I didn't encounter the empty page flash he mentined.

LE: I don't have that problem because I don't use async CSS. I didn't even know that was a thing, why would you use JavaScript to make sure the browser doesn't wait for the CSS to load? If JS is disabled you end up without any styles or have to add a noscript fallback. Also, why would you let the browser render FOUC?

</comment></comment><comment><USER32> The fastest google fonts are the ones you don't import.

</comment><comment><USER33> Here's a simple idea for the Chromium team: Bundle the top 100-200 Google web fonts (in .woff2 format) with Chromium (less than 20-30MBs) and boom, you just accelerated the entire internet.

<comment><USER34> What about all that juicy tracking data though?

<comment><USER35> What data do you think is tracked exactly?

<comment><USER34> I don't know exactly what they're harvesting, but I'm assuming Google isn't offering a free font API out of the goodness of their hearts.

Do you disagree? Maybe they're giving away a font API for literally nothing in return........

</comment></comment></comment></comment><comment><USER36> Unsafe at any speed.

</comment><comment><USER37> Does anybody else block fonts? Not only is it wasteful for my mobile data plan, but I just have this suspicion that sooner than later they will be used as a vector for some kind of security issue.

<comment><USER38> > _I just have this suspicion that sooner than later they will be used as a > vector for some kind of security issue._

You mean like being rendered into a canvas to get a high-entropy fingerprint of your device?

<comment><USER39> TrueType implementations need to include an interpreter for a Turing-complete language (the hinting language). More about vulnerabilities:

1\. [https://security.stackexchange.com/questions/91347/how- can-a...](https://security.stackexchange.com/questions/91347/how-can-a-font- be-used-for-privilege-escalation)

2\. [https://threatpost.com/of-truetype-font-vulnerabilities- and-...](https://threatpost.com/of-truetype-font-vulnerabilities-and-the- windows-kernel/101263/)

3\. [https://googleprojectzero.blogspot.com/2015/07/one-font- vuln...](https://googleprojectzero.blogspot.com/2015/07/one-font- vulnerability-to-rule-them-all.html)</comment></comment></comment>


Apple Music Matches Files with Metadata Only, Not Acoustic Fingerprinting - <AUTHOR> http://www.mcelhearn.com/apple-music-matches-files-with-metadata-only-not-acoustic-fingerprinting/ <comment><USER2> Uh.. pretty significant update to this post. Unable to reproduce.

 _Update: I've been unable to reproduce this issue, and my guess is that there was a glitch with Apple's servers that has since been corrected. If you only subscribe to Apple Music, or are using it on a free trial, then your songs are matched using metadata only. If you subscribe to both iTunes Match and Apple Music, then iTunes matches your songs using digital fingerprinting._

</comment><comment> SG- A lot of negative comments from people here, but I have to ask, have you used Apple Music and has this feature failed you? I didn't have any problems myself (not a huge collection, but it worked well for 24GB of songs).

Some people have mentioned that it can be easy to fool the system and gain free songs, but paying $9/month for Apple Music gives you access to every song either online or offline and you can add them to your library.

iTunes Match however is a different thing and they likely have to be almost sure the song you have is the song you should get access to from the iTunes Store.

<comment><USER3> My iTunes library is apparently 95.96GB (for music) and it's been working pretty awesomely. There's the occasional bug with iTunes itself, but Apple Music has been pretty solid.

> _it can be easy to fool the system and gain free songs_

I'm not sure what you mean by this. If you have Apple Music, you already have access to the entire catalog, so there's no trickery to gain "free songs", because they're already available. And if you don't have Apple Music, you can't do this either, because iTunes Match exclusively uses acoustic fingerprinting[1] to ensure you can never download a song you didn't already have.

[1] For non-purchased content. For purchased content they obviously already know you own it.

<comment> SG- Yes, I wasn't saying it's a problem to 'fool the system' and get free songs, I was mentioning that it's not a problem because of how it works.

<comment><USER4> Plus if they used fingerprinting couldn't you still circumvent that with a youtube downloader or even torrent downloading?

<comment><USER3> If you do that, then you already have the song, so you're not really getting anything out of Apple that way (besides making it easier to play that song on your other devices).

</comment></comment></comment></comment></comment><comment><USER5> Apple's been doing stuff like this lately all over the place. Total lack of attention. They're trying to do too much too quickly and the attention to detail Apple is famous for is quickly dwindling. Please Apple, STOP RUSHING EVERYTHING.

<comment><USER5> Not to mention the poor integration between Music and the user's existing library — its definitely not what I expected from Apple Music.

<comment><USER3> What poor integration? My entire library operates like it always has, except that viewing by Artists now has extra information about each artist in the list of albums, and also has a segmented control that lets me see all of that artist's music instead of just what's in My Music. And if I find a song I like, I can add it to my library pretty easily, at which point it shows up with the rest of my music just like all my existing owned music does.

Overall, it's actually working pretty amazingly.

</comment></comment></comment><comment><USER3> I read some time ago (I think on one of Serenity Caldwell's iMore articles) that Apple Music uses metadata to match _on iOS devices_ , because acoustic fingerprinting is too resource-intensive, but on the desktop it uses acoustic fingerprinting like iTunes Match has always done.

I don't know if this is true, but it does make sense. Although I wonder who actually has music on their iOS device that isn't also in iTunes on their desktop, because the only way you'd hit this is by adding an iOS device to Apple Music that contains music that iTunes did not have.

<comment><USER6> I didn't know you could use iTunes match from iOS devices but if Siri can be integrated with Shazam which has acoustic fingerprinting, then I would think they could do the same with iTunes Match on iOS devices.

<comment><USER3> You can't use[1] iTunes Match from iOS devices (for precisely this reason). It's Apple Music that you apparently can (I haven't tested but that's what I've heard).

Shazam does have acoustic fingerprinting, but it's much cheaper fingerprinting. And it's cheaper because Shazam is allowed to get it wrong. It doesn't have to get 100% of songs, and when it does get songs, it's perfectly ok for it to not recognize which particular performance a song is from if the artist has multiple versions.

But iTunes Match has to be as close to 100% accurate as it can (and better to avoid recognizing a song entirely, thus requiring it to be uploaded, than to mis-identify it as something else). Shazam is only listening to part of the song, but iTunes Match has to fingerprint the entire song, and the amount of processing it does per second of music may very well be higher as well.

[1] Where "use" means "upload music to"

</comment></comment></comment><comment><USER7> Serenity Caldwell wasn't able to duplicate this, probably a bug.

[https://twitter.com/settern/status/627162699076665344](https://twitter.com/settern/status/627162699076665344)

<comment><USER8> I agree - it is most likely a bug. If not it seems like this would be a huge hole.

<comment><USER9> I've had a dozen songs across several albums exhibit this behavior. Never mind elaborate acoustic matching -- I've had fifteen minute live performances of a song replaced with three minute studio versions, which should have been prevented by a trivial metadata sanity check.

I haven't been thrilled by the experience.

</comment></comment></comment><comment><USER10> Wow. If true, this is a massive flaw. I'm trying to think of a rationale for this approach considering they have the technology to match using the acoustic signature of the tracks.

<comment><USER11> I'm consistently surprised at how often I hear about hacky, poorly engineered solutions in Apple products (and those are only the ones that are externally visible/relevant to product quality directly). I can't imagine they don't have access to broadly the same quality of engineer as other big companies, which leaves the question of why presumably deliberate product choices were made this way.

<comment><USER12> My guess is inflexible deadlines for products and a certain death march culture for meeting them (from what I've heard (third-hand, admittedly) from people who work there) lead them to be forced to cut corners in some places.

On the bright side, Apple does usually eventually fix or replace the hacky solutions. The other side of that is that it sometimes takes years.

</comment></comment></comment><comment><USER13> Last summer, Sander Dieleman was working on recommending music based on audio signals, while interning at Spotify. Very interesting work:

[https://benanne.github.io/2014/08/05/spotify- cnns.html](https://benanne.github.io/2014/08/05/spotify-cnns.html)

<comment><USER14> Can't wait for a service utilizing this. I find finding new music hard.

</comment></comment><comment><USER15> iTunes Match would acoustically match songs, and then if the match failed, would just upload the song to iCloud as-is.

I imagine maybe this behavior is intended to replace uploading the song if the song doesn't match? It'd explain the situation in the quoted tweet where a live Phish show got replaced by a live recording, assuming that it failed to acoustically match and iTunes resorted to a metadata-based search instead.

</comment><comment><USER16> Yeah, this is totally the case. I imported a CD awhile back which didn't have any metadata. Now if I try and listen to it on another machine, I get some odd indy artist who likes drums and screaming.

</comment><comment><USER17> If this is true, you can create thousands of 1 second "songs" with different metadata and fill up your library really fast.

<comment><USER15> Unlike Match, Apple Music will DRM-wrap the downloaded files, so it doesn't really get you free music.

<comment><USER18> Technical difficulty of stripping the DRM? FairPlay was easy enough, I'm sure this wouldn't be much harder.

<comment><USER3> If you're going to intentionally commit copyright infringement, it's probably easier[1] to just pirate the music than it is to download it from Apple and strip the DRM, especially because downloading it from Apple requires having a paid Apple Music subscription.

[1] Note: I do not in any way condone music piracy. I'm just pointing out that it's more practical than stripping DRM. But really the best thing to do here is to just pay for your music.

<comment><USER18> I was merely questioning it from a technical perspective.

I don't much care either way. People want digital content for free, publishers continue to rape the idea of works entering the public domain in a reasonable amount of time. Its hard to feel bad about either party.

</comment></comment></comment></comment></comment><comment><USER19> I had a ton of Apple Music problems initially, but I couldn't be more happy with it now. I love Apple Music. It screwed up the metadata all over my library, had problems with adding playlists to my library. It turns out it was all because there's no way to reset iTunes Match. The old iTunes Match songs in the cloud were screwing up everything. I had to use a second computer to delete the songs and create a blank library to Apple Music before all my music would sync to the cloud correctly. Apple really needs to get it together with their iCloud platforms. The amount of bugs is getting embarrasing. But Apple Music as a service is pretty awesome.

</comment><comment><USER20> This also happened to me when I signed up to iTunes Match. At first it seemed everything was working properly, a lot of uploads as expected, but with time I realised there were some songs missing forever. Mostly bootlegs that were returning from the cloud as the original studio songs, I lost a lot of them. The most strange one was with Tool with the song "The Pot". The files on my iTunes were from the original CD and they all got a match but "The Pot" was returning as a 96kbps file! That was it, I stopped using iTunes Match that moment and will probably never sign up for any matching service again. Long live my several library backups in different locations. My library is sacred.

<comment><USER20> Forgot about this strange one: I own all System of a Down original and explicit CDs but iTunes Match got me the clean versions instead.

</comment></comment><comment><USER21> Lala (the iTunes match predecessor) at least took track length into account

<comment><USER22> Ahhhh Lala, forever missed! Among the best, and Apple shut them down. I gave up on my iPad and mac-book and went to PC after that let down. MediaMonkey and Spotify have my business.

</comment></comment><comment><USER23> Tangentially related to this, but I bemoan the fact that there's no portable playlist format. I have various services my music is on, and I wish there existed a playlist format that detailed every piece of metadata you had per song, such as file path, IDv3 tags, AcoustID, etc. That way, I could load the same playlist file on Winamp, Spotify and iTunes and have the songs available in each immediately, even if one was a cloud services and the paths were different in the others.

</comment><comment><USER24> I have a particular hip-hop album on my phone that is an orchestra version of the original. Every time I attempt to play the studio album, I hear the orchestra (live) version. It's extremely annoying, and I hope they fix it.

</comment><comment><USER25> I'm pretty sure they use audio fingerprinting (Gracenote MusicID has been cited) but using metadata with track lengths would probably suffice most of the time without too much piracy risk.

</comment><comment><USER26> It's hard to imagine how such a huge oversight made it all the way to the final product from a company as huge as Apple. No one thought about this along the way? Or if they did they were ignored?</comment>


Oracle prohibits double encryption - <AUTHOR> http://docs.oracle.com/cd/B28359_01/network.111/b28530/asossl.htm#i1006461

<comment><USER2> Don't run encryption with our backdoored encryption?</comment>


Ask HN: Providing customer analytics - <AUTHOR>

Hi guys,
For those of you have SAAS-businesses, what do you use to provide analytics for your users? Do you build on-top of Google analytics or Mixpanel or is there some sort of service that I can hook into?
Thanks! <comment><USER2> I'm going down this path and building it myself. Though I provide software and service rather than "SAAS".

I started comparing the time vs. income per customer. The best ones never call, rarely use the product and pay on time. I plan to factor in more time and $ costs but it will probably be the same result.

Now I want to measure how effectively I am empowering my users.

</comment><comment><USER3> I'd like to know too. I think they implement it themselves but who knows...</comment>


Haskell version of Norvig's spelling corrector - <AUTHOR> http://marcosero.com/blog/norvig-haskell-spelling-corrector/ <comment><USER2> > I wrote this code putting brevity over readability, which is something I > usually never do

Shouldn't the point of such a post be to show interesting code? I'm having trouble reading through the densely packed source.

In addition to tromp's minor nitpick, I have several major ones.

\- the code is full of redundant parentheses. HLint can detect those (and many other style errors) automatically. LPaste has HLint installed so you have a linting pastebin available online. [http://lpaste.net/116871](http://lpaste.net/116871)

\- A lot of the functions are written in a non-idiomatic way. "m >>= return . f" is "fmap", "(.)" can combine functions much more readable than Lisp stacks of parentheses.

\- ByteString.Char8 is usually a wrong choice, more on that here: [https://github.com/quchen/articles/blob/master/fbut.md#bytes...](https://github.com/quchen/articles/blob/master/fbut.md#bytestringchar8-is- bad)

\- If you count to "length x" then often there's a more elegant solution that avoids calculating the length altogether. For example "splits xs = zip (inits xs) (tails xs)".

\- Brevity is never better than readability.

\- No top-level definitions should lack a type signature. GHC even has warnings for that (I think they start firing with -W).

\- A function should do one thing and then be composed with other functions. "lowerWords" converts to words and then maps them all to lower case, for example. These are two completely different operations in one long line.

\- In order of increasing generality: foldr union empty = unions = mconcat = fold

\- Use pattern matching, avoid "(!!)". transposes w = [ a ++ [b0,b1] ++ bs | (a, b0:b1:bs) <\- splits w] - also see [https://github.com/quchen/articles/blob/master/fbut.md#head-...](https://github.com/quchen/articles/blob/master/fbut.md#head- tail-isjust-isnothing-fromjust-)

\- For large amounts of words that you split and concatenate again, String is probably not the right type. Text is good for dealing with such things.

\- replaces w = [as ++ [c] ++ bs | (as, _:bs) <\- splits w , c <\- alphabet]

... and so on.

<comment><AUTHOR> Hi, author here. I think you partially missed the main purpose of the article, which for me was just having fun by playing with a language I'm currently learning. I wasn't try to teach anything to anyone.

But I must say, thanks for the great feedback! Lots of stuff I didn't know that we'll make me write better Haskell code :)

<comment><USER3> Well, what you wrote is "The main reason I did it was to see what Haskell is capable of compared to other languages such as Python." The problem is that what you coded isn't what Haskell is capable of :)

</comment></comment></comment><comment><USER4> Minor nitpick: the first real line of code

      alphabet = "abcdefghijklmnopqrstuvwxyz"

is better written as

      alphabet = ['a'..'z']

This is really syntactic sugar for

      enumFromTo 'a' 'z'

using the function

      enumFromTo :: Enum a => a -> a -> [a]

from the typeclass Enum for enumerable types, and the fact that a string (type String) is just a list of characters (type [Char]).

<comment><USER5> As long as we're picking nits…

> I wrote this code putting _brevity over readability_

Overall, this is not particularly terse, for Haskell code. With all the lambdas, it looks like OCaml! For example, these are equivalent, and I find the latter clearer:

        (sortBy (\(_,c1)(_,c2) -> c2 `compare` c1))

        sortBy (flip (comparing snd))

Now, it's not necessarily a bad thing to be explicit, but in cases such as these, it's less repetitious to just use the standard library functions.

<comment><USER2> For reverse sorting, there's a type that does specifically that.

        sortBy (comparing (Down . snd))

See [http://hackage.haskell.org/package/base-18.104.22.168/docs/Data- Or...](http://hackage.haskell.org/package/base-188.8.131.52/docs/Data- Ord.html#t:Down)

<comment><USER5> True, but I prefer not to use typeclasses in that way.

</comment></comment></comment></comment><comment><USER6> Interesting read for a Haskell newcomer like me!

Regarding the original webpage of Norvig's spelling corrector, I think it is not up to date as I remember browsing the web and finding some shorter versions in other languages.

I've shortened the Python version to 14/15 lines using some features of Python3.

</comment><comment><USER7> Cool! Since we're suggesting changes, here's what I'd do. (Not that anything is wrong with the OP's code, just that it's good to point out all the different stylistic techniques you can adopt.)

        7. alphabet = ['a'..'z']
        8. nWords = B.readFile "big.txt" >>= return . train . lowerWords . B.unpack

or:

        8. nWords = train . lowerWords . B.unpack <$> B.readFile "big.txt"

Make `splits`, `deletes`, etc. values (not functions). `splits` has access to `w`, so there's no need to pass it as an argument 4 times (or even to pass `w` as an argument to the other functions).

        27. sortCandidates = (sortBy (flip (comparing snd))) . M.toList

<comment><USER8> I used to compose return with a series of pure functions as well, but I found that using liftM seems cleaner.

<comment><USER8> example:

        nWords = liftM (train . lowerWords . B.unpack) (B.readFile "big.txt")

There was recently a very good article[0] about practically using monads that mentioned using liftM.

However whenever using a functor instance is possible it's probably better, since functors can't do as much as monads. I'm not quite sure how much this would help/apply to this small example though.

0: [http://softwaresimply.blogspot.com/2014/12/ltmt- part-3-monad...](http://softwaresimply.blogspot.com/2014/12/ltmt-part-3-monad- cookbook.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SoftwareSimply+%28Software+Simply%29)

</comment></comment></comment><comment><USER9> Not to make any particular point, but mainly just because I fancied a bit of procrastination this afternoon, here's a CoffeeScript version (heavily leaning on Underscore): [https://gist.github.com/benshimmin/2ee78c932797faadfc89](https://gist.github.com/benshimmin/2ee78c932797faadfc89)

</comment><comment><USER10> Which "proves" again that programming is neither about OO nor about purity..)

<comment><USER10> Where I am wrong? This is a straight-forward translation of non-OO Python code into Haskell, isn't it?

So there we can't see any "benefits" of truly-OO (original code has been written in a "functional style") or pure-functional approaches (the code has no "benefits" being converted into a pure-functional language).

Lists and Sets are "classes" in Python, but it doesn't matter, because implementation of "basic" types does not alter the behavior - sets could be implemented out of Lisp's conses.

Btw, knowing who the author is and seeing some "functional patterns" in Python code, it is very probable that original corrector has been prototyped/written in Common Lisp, then re-written in Python, and now re-written in Haskell.

The point was in an elegant algorithm and compact implementation, not in language of choice or in particular programming paradigm.</comment></comment>