673 karma · joined June 27, 2013
B is indented with a tab, plus the requisite number of spaces to line up with the above line.
C is indented with a tab.
Learning to deal with stuff yourself doesn't preclude asking your partner for help with making a decision that can impact both of you for the rest of your lives.
In practice I don't know if anyone is overly concerned about this. While Rust doesn't have linear types, I find you have to bend over backwards to introduce a situation where you might accidentally leak a resource.
Tarean makes a good point with respect to fusion, but "guaranteeing" fusion requires additional assistance from the compiler in addition to the basic implementation of linear types.
In a purely functional language with affine types, unused variables are usually just optimized out.
open : () -> File
close : File -> ()
write : (File, String) -> File
let f: File = open()
let new_f : File = write(f, "Hello world!\n")
close(new_f)
If this seems clumsy or error-prone, notice that you can't accidentally close() f instead of new_f, and you can't forget to close() new_f, so there is actually very little room for error here.As an example, compare two languages: one with linear types and one with affine types. Let's say that you had a "File" type, a function "open()" that creates a file (either linear or affine as appropriate), and a function "close()" that consumes the file. Then this code would be legal in both languages with linear types and languages with affine types:
let f: File = open()
close(f)
Note that "f" is used once and only once, at which point the value is consumed. In a language with affine types, this is also kosher: let f: File = open()
// Do nothing
This fails to compile in the language with linear types because "f" is never used. Finally, this code is never legal in either language: let f: File = open()
close(f)
close(f)
... because "f" is used twice here, and neither linear types nor affine types allow that.So affine types give you a little more leeway.
Ugh, no. There are references all over the place when I write Rust code -- it would be a serious bummer for me if annotating those types and making those references took up 4 characters for "ref " instead of just the 1 for &.
It should go without saying that this system is not Turing-complete anymore if you bound the runtime.
> An algorithm that takes infinite time for 1 instruction is O(1) and still constant time.
> An algorithm that takes infinite memory for every run is still a constant memory complexity.
None of these are true.
D has optional GC but their standard library is kind of fucked up.
Obviously policies that are meant to target fake news wouldn't touch opinion pieces about the best Christmas gifts.
> What puzzles me about the discussions around “fake news”, is how everybody in favor of free speech is now calling for censorship. Like, really? Don’t you see where this will lead — ”a Ministry of Truth” and other things that only 1984 could have envisioned.
There is no one prominent who is arguing for unilateral government censorship of fake news sites. What has been proposed are a series of reforms, usually outside of the legal system, to help people identify blatantly incorrect but otherwise convincing-looking articles on big platforms like Facebook, which bears no resemblance to anything Orwellian.
For the record I'm not an RMS-ite and I don't actually mean to compare proprietary software with slavery.