144 karma · joined January 22, 2015
soundness question when considering variance
What is this question? Have you got a reference?All that said, I kind-of agree with you. It would be nice to have some easy to grasp explanations of how to compile higher-order functions to actual machines, x86, ARM, MIPS ... This material can be found e.g. in Appel's book [2], but I don't think it's available freely (and legally) on the web. I think this is in parts because the compilation process is not so easy: you need to understand the compilation of normal languages, in particular stack layout, and then add more pointers. You also need to think about how to do memory management if a closure lives longer than its creating context. This is quite rich material, and not even usually covered in undergraduate compilers courses.
The situation with concurrency is much worse, but that only reflects the fact that this is far from a solved problem on many levels. To cite a recent paper [3]: "Despite decades of research, we do not have [in 2015] a satisfactory concurrency semantics for any general-purpose programming language that aims to support concurrent systems code [...] Disturbingly, 40+ years after the first relaxed-memory hardware was introduced (the IBM 370/158MP), the field still does not have a credible proposal for the concurrency semantics of any general-purpose high-level language that includes high-performance shared-memory concurrency primitives. This is a major open problem for programming language semantics."
And memory models are but one issue to deal with in concurrency.
[1] http://research.microsoft.com/en-us/um/people/simonpj/papers...
[2] A. Appel, Modern Compiler Implementation in ...
[3] M. Batty et al, The Problem of Programming Language Concurrency Semantics.
The lack of side-effects and equational reasoning in functional languages let you get a lot of details out of your way.
Actually ... You (kind-of/sort-of) need side effects when implementing a language with higher-order functions. You at least need it for generating fresh variables to avoid free name capture. Yes, I know you can do this with a monad, but this is not going to help a beginner. It's much easier to maintain a global counter that you increment every time you want a fresh variable name. Why is programming way easier in Ocaml than in C?
I've written vast amounts of Ocaml and C/C++, certainly over 100K LoCs in each. Programming in ML dialects is so much easier than C/C++, it's not funny. I'd estimate it takes me about 10 times longer to implement the same functionality in C/C++ than in an ML dialect. The three key features enabling this difference are the following.* Garbage collection, removes all memory bugs, avoids tons of ugly and distracting (de)allocation commands and keeps your head free to think about more important stuff.
* Pattern matching, enables you to code up complex decision making code (and most functinality needs this) in a readable and maintainable way.
* higher-order functions allow you to parameterise code with behaviour in a neat way.
(There is one caveat, which is code for extremely high performance, I'd probably write that in C/C++, but this is not an issue concerning a learner.)
As to useless car analogies, I think implementing lambda in C is like saying: Today I'm going to learn how to build a car. First, let's do this while riding a uni-cycle ... oh... um...
We saw this from the likes of Stalin, Mao, Pol Pot ... to Anti-Gamer-Gate. In this context claims of harassment are a smokescreen that are being used to cover up the exposed corruption. They appeal to the damsel-in-distress narrative that so many men so easily fall for. It's quite an effective strategy, and some guys like John Flynt (aka Brianna Wu) make quite a good living of it seemingly. Maybe you should also try it when your software isn't good: wear girls clothes, send yourself some threatening emails and whine about harassment on TV ... worth quite a stack of paper I hear.
BTW Wikipedia is not a credible source.
So maybe you should reflect on the conditions that have duped you into taking such a simplistic position.
Then "twobits" would say "Which John never sees, and the money go immediately to bailing Tom who created the problem in the first place."
[1] https://en.wikipedia.org/wiki/Sovereign_default#List_of_sove...
The real question is: why is Greece not going the democratic way of defaulting on its external debt? And the answer is, as you know well, that Greece wants to continue receiving all that sweet EU money. Why stop a good thing?
... impose non-sensical demands ...
Have you considered that not everybody thinks that fighting corruption,
tax-avoidance etc is non-sensical?Anyway, what is deemed risky is highly subjective and easy to see only in hindsight.
While this is a consistent position that has historically been held by some, it's incompatible with any modern economy. In particular it is incompatible with the modern concepts of old-age pension, health insurance, unemployment insurance etc.
Syriza wants to be forced out of the Euro so they can continue to play the xenophobic game and blame Europe, or rather Germany. The rest of the EU wants Greece to decide to leave, so they don't have to go to their voters and say "we tried everything, they didn't want help ..." and avoid admitting that the critics of the bailout were right all along.
In this game, time is on Greece's side, because as long as nobody blinks, all that sweet EU money is still raining down on Athens.
unelected officials trying to smack down democratically elected wishes
Greece can immediately get rid of EU and IMF officials if they want. All they need to do if forgot the free money that has been raining down on Greece.In the context of prostitution, the term "human trafficing" itself us primarily used for shaming purpose where prostitution is no longer illegal. For this reason it should be avoided like the plague.
It should also not be forgotten that the UVA rape hoax story was covered uncritically by all mainstream media and not just in the US, even though it smelled like a hoax from day one. Same with the 'mattress girl'. Nobody will be fired for this at the Guardian, at the NYT, at ... Critical journalism is dead.
I was talking about the mechanism for array indexing. In both cases, indexing is function application. So the choice of error representation is orthogonal. This is even more evidence that we should not use a different operator for array indexing as Rust does alas.
Array indexing is a function call, because an array is a function from its index set to the set of the values the array stores, or -- equivalent -- a partial function from integers to the value set.
Scala gets this right.
There should be, but this would only be doctoring the symptoms. The real solution is to abolish the ridiculous, sexist/misandric alimony laws. In the past there was some good point to them, but they have all been made obsolete by technological development (contraception, pregnancy loosing its medical dangers, societal changes). The only acceptable (default) rule is no alimony, and 50/50 shared custody of children.
In order for such a long-overdue legal change to happen, men must use their vote. The majority of women will be against such a change since the current legal arrangement benefits them so disproportionally, so men will face stiff opposition.