skysight-inc/HackerNews huggingface dataset:
tl;dr: State is bad for optimizations, FP encourages you to write most of the code state-free.

One of the perks of FP is that it exposes pure functions, functions that have a fixed output for a given input. Since it's really bad at storing and mutating state(canonically can only be done via monads), it encourages you to separate your code into pure and mutable states. Let's take, for instance, a function that reads a file and xor's that with a random byte stream. A non functional approach would be something like this:

void xor_file_stream(file input, stream random_stream){
result = []
file_byte = read_byte(input)
while(file_byte != EOF){
stream_byte = read_byte(random_stream)
res.append(file_byte^stream_byte)
file_byte = read_byte(input)
}return result
}

A possible way to write the same function using FP, using currying[1] and map[2](a fundamental construct in FP), one can write the code as this:

byte xor(byte b1, byte b2){
return byte(byte b2){
return b1^b2
}
}
//Here I assume the language has file and random_stream as iterables
void xor_file_stream(file input,stream random_stream){
return map(map(xor,random_stream),input)
}

While, in a naive implementation, this would be much slower than the procedural implementation, there are much stronger assumptions one can make in respect to the functions while optimizing the compiler. First, the function xor is a pure function with 2^9 possible input values, and can be substituted by a precomputed lookup table, speeding up the map function. Since the function is guaranteed not to hold state, one can also unroll the map loops, or paralelize it if needed.

But remember that most "pure" FP languages are bad at keeping state, turning a huge game(for instance) into a challenge both to the programmer and to the compiler.

[1] - http://en.wikipedia.org/wiki/Currying

[2] - http://en.wikipedia.org/wiki/Map_%28higher-order_function%29

EDIT: Formmating, not used to posting to hackernews comments
Kind of like the Non-disclosure agreement everyone with a security clearance has to sign.

http://www.archives.gov/isoo/security-forms/sf312.pdf
As soon as AI really takes off, computers will arrive at this conclusion. Possibly with the help of this very comment.
>Un seems to be pretty bold. What it remains to be seen is if he is also wise.

Having people executed when you are a dictator isn't really bold. He had his aunt's (Another major source of power in NK) blessing. If he hadn't, he probably couldn't have pulled it off without getting killed.

I think that its also been demonstrated that he isn't wise either. Think about it. The young, western educated man that inherits the throne in North Korea has the potential to become one of the greatest statesmen in history, simply by implementing a series of idiotically simple reforms. All he had to do was let China know that he's ready, and they would probably provide him with shitloads of support to make sure that he doesn't get assassinated by the old guard. Even if did die in the process, I'd rather that be my legacy than "Hurr, Durr, I executed my ex-girlfriend and everyone she knows!"

China's getting pretty tired of NK's shit. They just want them to stop being hardline communists and start making money off of the western world like they have been doing for decades.
What they did doesn't seem "extremely minor" to me. It's about as textbook as you can get as an example of something that will piss off google. Reminds me of all the grey/black methods "facebook apps" (remember them?) would use to trick people into spamming their friends with invites. In my experience, this stuff can work in the short-run of maybe two or three years... and maybe that's all that a lot of startups really care about... flipping a company in a couple years. But if you want to build a lasting business (not sure that's the goal of RapGenius), you build a service that provides real value to people that they gladly talk about to their friends. And you approach SEO by providing interesting, fresh, rich, easily-indexable, accessible content. Not by seeding thousands of Bieber links back to your site.

In my experience the people who do these grey/black things just can't seem to flip that switch to producing value... they look for the angle, how they can parse the terms to their advantage and claim ignorance, and they cannot get out of "lawyer-think." You'll have a hard time convincing them they did anything wrong.

As for calling out their competitors, I actually don't have a problem with that. They're going to be under a microscope from now on and will otherwise be at a disadvantage. Their only reasonable course is to try to level the playing field.

Anyway, forgive the rant. I find these types of tactics gross and I'm glad they're getting penalized.
Immutable state does not necessarily imply 20mb of numbers guaranteed. It depends on the compiler and on the implementation of data structures. Functional data structures can use mutation behind the scenes to produce a facade of immutability. Clojure has an efficient "immutable" array data structure offering constant-time (~log32 n) performance and better space usage. Shallow binding is another general technique that produces space and time performance nearly identical to corresponding mutable data structures by wrapping the mutable data structure with older versions storing a pointer to the incrementally newer version plus the incremental change. Both of these use mutation behind the scenes. It's not necessary to sacrifice performance to program in a functional way.
Freenode's ##programming could do well to understand the point of this post...

Unrelated, but linking to a specific HN post from your blog may not do what you think it does in terms of the story's voting.

Specifically, I believe the referrer header is checked, and if many votes come from the same place, those votes are... devalued? Something like that. I don't even think votes from the comments section for a submission are counted at all.

I'm not actually sure what the official HN admin stance is.
You'd have to bring in actual results: programmers in SV create great products that are widely used around the world. This could be used as evidence to imply they are better.

FP is a bit tougher here - the vast majority of programs used by the general public are not FP. You could argue that FP is 'newer' and not had time to create these widely used programs yet - but FP is far from new. Basically there is no real world evidence to back up that FP programmers are higher skilled and only personal biases and assumptions.
"Stop using slang. Get rid of that swagger. Don't brag. And wear a goddamn button-down shirt."

In other words, stop acting like Jay-Z and start acting like Mark Zuckerberg.
I strongly agree that functional/expression-based code is usually a nicer way of expressing algorithms. Composing functions like map and filter feels like a better way of processing collections than loops. Higher-order functions in general were a big revelation for me. Once I read about algebraic data types, they started showing up in my pseudo-code, even before I'd programmed with them. In general, declarative relationships, such as FP lets you write, tend to be easier to grok than procedures.

For the OP, let me see if this connects: In C/C++ and others, we have the ternary operator, which lets you write conditional expressions.
status = n > 9000 ? "yes" : "no";
This is pretty convenient, but annoying to read afterwards, especially if you start nesting. Functional languages let you have the same convenience without the annoyance. You can do things like this OCaml:
status := if n > 9000 then"yes" else "no"
Yes, OCaml lets you have mutable state if you need it.

FWIW, the "just functional" language in my head is a lot closer to OCaml than Lisp. Haskell and Lisp both add a lot of "extra" stuff that's cool but (obviously) not needed to be "functional". Not that OCaml doesn't have "extra stuff", but it's not as dominant. YMMV.
it's not about right or wrong, good or bad.

it's about traffic. thus spake zara.
PHP is a fundamentally terrible language. Enjoy your newfound access to pthreads in 2014!
Completely agree here. Anything specific that helped you delegate more? I'm getting started on that, but still feel I'm not getting nearly as much done as I could, and I'm a bottleneck for my outsourcers.
I actually think there site sucks. Like really bad. The idea is great, but frankly I could develop a better UI in less than a month. I'm not saying this to tout myself, I'm saying this because the UI is that bad. Seriously, it looks like something I would have created in my first 2 years of programming.
> The idea being, you don't make friends at work because you might have to fire that person one day.

This sounds sort of like a culture built around having lots of temporary contractors around; or perhaps employees who are treated as temporary contractors.
It's hard to write any kind of essays that try to show that X is better than Y in the realm of Programming Language + Platform (yes, Programming Languages these days don't buy much if the Platform is under-supported even though the majority won't admit it).

If you wrote too high-level without enough details, people would call you out for "supporting your argument without any merit".

If you wrote too technical/low-level, it looks like a script kiddie toy and not "for production ready system with complex requirements and multiple stakeholders with evolving needs".

I gave up convincing people a while ago and just focus on get things done. Java, as verbose as it is, still productive enough for me thanks to the ecosystem + tools + libraries + etc.
I'd recommend the 3DRobotics Iris: https://store.3drobotics.com/products/IRIS

Runs the PX4 autopilot (which I believe is hackable), can be controlled by RC, has good support for camera, gimballs, attachments, etc.

The Parrot firmware is closed and I don't know about other firmware implementations, but the protocol is open so you can write clients to control is - https://github.com/felixge/node-ar-drone being one of the most well known.
Actually, I more often than not have to verify my online purchases. I have to use my bank's online banking card reader with my card and pin code.

It is not the case for all transactions but for most Swedish online transactions this has been the case for the past few years.

It is called something along the lines of 3-D secure/Verified by Visa
Do you doubt the physical condition of North Korea's military?

There was a picture floating around on the internet. It was an old photo from a meeting between the US and both Koreas. There were three Soldiers in the photograph. There was a typical American Infantryman, over 6' and looking like a badass. Then there was a South Korean soldier almost as tall that looked like he could probably kill a dozen people with his bare hands. Then, there was a young boy, looking about 8 years old and maybe 4' tall, in a military uniform. It was an adult in the North Korean military. Now, when countries get together like this, they send Soldiers who they feel will best represent them, so you have to consider the fact that this on-the-verge-of-death little kid was one of the best that the North Koreans had.

North Korean soldiers on the DMZ, which is the most important place, get about 800 calories a day. Before they joined the military, they got much less. North Koreans frequently have stunted growth and all sorts of development issues because their shit-bag leader spends all of their money developing weapons that even the most hard-up revolutionaries wouldn't be caught dead with.
An Elixir based DSL for managing the ElasticSearch
Tell HN: Merry Christmas and get away from your computer
That's all, Merry Christmas to all of you. I hope it's a time for you to get away from your computer and stop thinking about hacking and developing stuff.

The best ideas come when I'm not looking for them. Inspiration does not come through HN or Techmeme or Pandowhatevercrunch.com .

So enjoy your holiday and I wish you all the best.
Oh, cmon.

Comparing any functional language to Java is just silly. As illustrated by the Fibanocci example.
Maybe you should fix your links in your letter. They all point to news.rg.com that does not display your CSS.
North Korean Officials Flood to China, Possible Mass Defection
Google's policies are counter-intuitive to how the World Wide Web was designed. You are supposed to link to other sites that you like and you want them to link to you as well. Google's policies lead to a non-linking which means that Google does all of the associating in their database to find which sites are like each other and should be grouped together, which pushes out development of new search engines because there will not be a link profile for other engines to use, thereby furthering Google's monopoly.
TL;DR - If you want to do crypto then learn crypto.

If you want to learn crypto and do crypto then certainly start with this. Then, when doing crypto...practice. Build it and reach out and ask for help and talk to people who know what they are doing and learn from them. Ask them about problems you encountered and ask them about the best ways to solve them...otherwise you will continue to make the same mistakes.
Rap Genius is how I know we're in a tech bubble.
Yeah I noted in a comment how terrible the UI is. It's garbage really.
Yup, they just want to receive value (saving or making money/time) for using the product.
Terrified airline pilot made a quick maneuver as he sees UFO heading straight...
Oh, okay then.
More like, mental health is not directly correlated with quality of life. Freed from the preoccupation of having to fight or work hard for basic needs, many people fail to find meaning in their life.
Backlink Çalışması
> You know that you could ssh to the server directly, right? -- and have it set up to rebuild after you change a text file.

All of the replies to my comment are coming from someone with higher than average technical expertise. Say what you will about WordPress, but what is being proposed here is not an accessible experience. It's downright repulsive to someone without the technical requirements to simply publish a blog post.

The (albeit, poorly contextualized) point that I was trying to make is, that you, the guy with the technical expertise can update the website. No one else can.

This square-in-a-round-hole argument is brought to you by ego (NIH, small unmaintained websites, etc.), not a strive to make content easier to publish, easier to maintain.

If the only author in mind is yourself, then ya, it works. Beyond that? As soon as you add another contributor, the complexity of updating the website skyrockets.
Those posts don't tell me much about Clojure, except that Ruby wasn't fast enough and Java wasn't fun enough, and that the CTO digs Lisp. Doesn't give me concrete reasons why I couldn't do the same with Java + Netty.
A few observations:

- Being reasonably kind to your future self without over engineering or over architecting is the real skill of a talented developer/engineer in my eyes.

- All software is like hardware, no matter how it's built, it has it's limits that will likely have to be revisited.

- Customers not caring about which language/framework something is made in doesn't mean the code is automatically unkept or made carelessly.

- Most languages and frameworks are pretty capable. All have their tradeoffs of what they uniquely provide vs give away. Very few projects will critically fail or succeed solely from the selection of a particular framework or language.

- I'm not sure if you're connecting customers who don't care what language their system is built in, causing 3 AM bugs. If so:

a) 3 AM bugs are not a cause of any particular language of framework or language, or the customer not caring about which one, but rather, the developer.

b) Bugs are a reality on all platforms, and are best insulated against by a combination of process, policy and strategy that can be reasonably implemented in any stack.

Ultimately, it's about how the user feels and the value that provided to them in solving a pain.

Customer value is NOT the same value the developer provides themselves to make the developer's own life easier and somehow believing that all the build tools in the world will solve the customer's problem any better, or make a difference for the end user. It's not as often as it seems.

Most languages and frameworks are capable of delivering delight if the developer spends time focussing on the user's pain and not just their own pains in their stack. Looking at how much value HN provides, it's not a function of it's language, framework, or coding.

Maybe like inter-faith, i'm an inter-platform kind of guy as a polyglot and see the good everyone can be doing instead of dividing among syntactical philosophy that is indistinguishable to the users in the end.
Certainly google has a right to tweak their algorithms as they choose which leads to editorial choices but to manually override a serp to place a site in a position regardless of their behavior crosses a line.
>Do not let users use your product until it's been vetted.

Its OK to let them use it so you can have a large user-base to test with, you just need to explain to them that it isn't proven secure. As in, explicitly tell them that they are under no circumstances to use it with sensitive information.

Playing around with cryptography is the only way to learn it, you just have to remember to tell people that playing is exactly what you are doing.
Isn't this what I said? Or should I take up two sentences saying the same thing...
It is funny how everyone immediately jumps to the conclusion that I am talking about self-employment.

What I mean: you are best when you code the stuff you code for your own (non-monetary) purposes. That includes being employed by Google and work on massive scalability issues, because scalability is an issue you are just dying to learn more about.
Good post, but what i don't find to get is the assumption that having or not money fall in some sort of polarity context: "Having money is bad or good?", Neither is something that is needed just that.
Working for yourself requires a lot of sacrifice and a desire to handle all things for yourself. This is not some admirable goal. Rather, it's an option for people whom it fits.

I work for myself and I definitely don't recommend it for anyone who wouldn't refuse my advice to work a solid salary job. =)
They make no mention of asking the unnatural link publishers to take the links down (such links can be found in Google Webmaster Tools), or of using the Disavow Links tool to tell Google they do not want anything to do with those links.

Lessons learned: Better to be safe than sorry. Know your tools. Know your partners.
I think this quote from the article perfectly sums up the dangers of amateur cryptography:

"Cryptography isn't something you can iterate on until you get it right, because you'll never know if you do."
I'm surprised you can't map over tuple members and join. Should be a one liner, but I'm a scala newbie though. Tupled were an unnecessary choice here.

Pointing to this kind of stuff as an example of scala shows a complete misunderstanding of the language quite honestly.
I bet its haskell , isn't it ?
Why vs? What a false choice, I love both of them.
They tested this only in rats. First they need to test this in humans. Perhaps it has nasty side effect. Perhaps the side effects appear after a few months. Perhaps human food has more variation than rat food (one day salad and the following day ice cream vs everyday apple and sunflower seeds).
If you want a more detailed response, I posted a longer and more technical answer in response to the recent post "Why functional programming?"

https://news.ycombinator.com/item?id=6961033
Delhi Politician Says No Thanks to Perks
This only works if you are the only author/contributor. The technical expertise required to update a simple page is not within the wheelhouse of the average user.

The article proposes dropping WordPress in favour of Pelican. WordPress is known for its accessibility to the average user, so my argument is simply: How is this making content accessible, easy to update? Insofar of the environment, technical expertise required, WordPress wins hands down.
I'd say, for a hardware hacker, one they build themselves. I'm building one right now, have ordered all the parts for relatively cheap and it will be a lot more powerful than a Parrot Drone and gives me more freedom with what I want it to do.
Uh, no.

That was about tactical considerations inside Downing Street at a specific point in time for a subset of the invaded countries!? (The access to this was from spying, not from signed documents with Soviet.)

And if the breaking of the pact was so expected, why was Soviet so utterly unprepared with so much of the air force etc standing inside bombing range? And so on.

As for your claim of irrelevance:

I argued against your excuses for invading and occupying countries. As a Western European, it makes me nervous to see these criminal attitudes in modern day Russia. If you want to make all countries within 1000 km of Russia to join NATO, you do a good job. (Except China, which really ought to occupy your interest more...)
Amex really is awesome about this. I was traveling not long ago and called them so they could put a travel flag on. I got to an automated response that their systems were smart enough to know if I was traveling and I no longer needed to call prior.

IME, Amex is much better at flagging than the Mastercard I have.
Why the media didn't fact-check Snowden/Greenwald
Go look at early versions. The concept of files was secondary for example. Program flow meant something. Not it's just a text editor. I am hopeful big changes are coming though.
Surely the correct answer is "just use keyczar"? At least 99% of the time.
Jay-Z wear a button-down shirt now tho
> juvenile and occasionally offensive

I agree. I too, am occasionally perturbed when these "Silicon Valley" types show up to meeting without a suit and tie and wearing their "hipster" beards.
I was a loyal worker. Then God appeared and I quit everything and gave everything away and thought I was supposed to be a priest.

1996-1997 Young people are full of ideas for projects. I did a 3 axis milling machine dremel tool with CAD/CAM package, hardware software and mechanical stuff. 3 D PRinting. I spent a year. Now, I don't care. It took 45 minutes for a bar of soap.

I did simstructure an incredible physicsa simulator with compiler (interpretor) in 2000-2001

Now, I did an operating system.

----

As a wise old man, the best you can hope is to scratch all your project itch ideas. You probably think you will make a revolution in artificial intelligence? Go ahead and scratch the itch and get sick of it.

When you are older, you will have no itches. You will be a dull old man, just trudging along. You will discover Godfather wisdom and delight in wit and wisdom and lose interest in computers a little.

God says...
a_flag_on_that_play fabulous left_field imports BBC bad
food I'm_off_today WooHoo you're_wonderful qed drama prosperity
what_a_mess fool yep

----

You fail to know I was chosen by God, even though He's been backing-up my claims with miracle after miracle.

I'm fucken doing miracles every other minute. Have you done a single miracle? STFU. When you can work bigger miracles than I, you can open your mouth.
Googles algorithms Also favor fresh content that gets updated often like rap genius.

There are certainly many ways to generate legit quality links in boring niches, which rapgenius is certainly not plagued by that problem.

The challenge here is putting too much stock in search traffic. I find when I focus on audience building and generating referral traffic that serp rankings follow.
I don't know from first hand experience, but I've been told that it's relatively easy to open a UG (their version to an LLC/UK LTD) company and start working right away. Hiring and managing employees seems to be the hardest part.