Better HN
topnewbestaskshowjobs
Log inSign up

fmap

785 karma · joined Jan 15, 2011 (15y ago) · 257 submissions

Submissions

comment 9y ago · link · parent

> I don't know why computer people's category theory always looks so foreign to me. Sometimes I feel like we're in completely different worlds with vaguely similar-looking language.

Well, another way to think about it is that we are using the same language to talk about very different things. For example, in homological algebra you are always working in (at least) a pointed category. In computer science a lot of the things we are interested in are already reflected in the partial order induced by a category (i.e., subtyping). If your category has a zero object the latter is trivial and so we're pretty much never looking at pointed categories.

comment 9y ago · link · parent

Nitpick, but the idea is even older, going back at least to Girard (1971) and Reynolds (1974). :)

I don't know exactly what the problem is for Go. There are tradeoffs, e.g., just with the type system: impredicative, stratified or predicative quantification, implicit subtyping or explicit type instantiation, value restrictions, variance handling for mutable inductive types, Hindley-Milner or bidirectional typechecking, etc. There are more tradeoffs with the implementation. Fortunately, these are all well understood by now.

However, it is also true that many mainstream languages famously got generics wrong. What's most infurating about this situation is that a lot of research just gets ignored. If the question is really "should Go have generics whose design is based on C++ templates and/or Java generics" then the only sane answer is a resounding no.

comment 9y ago · link · parent

> For loops do not get the job done easily enough.

There was a nice paper at this years POPL which (in my opinion) allows you to substantiate this claim.

The paper is "Stream Fusion to Completeness", by Oleg Kiselyov, Aggelos Biboudis, Nick Palladinos, and Yannis Smaragdakis. The actual question in the paper is how to compile away stream operations to imperative programs using for/while loops and temporary variables. On the other hand, if we look at the output of the compiler we can see how complex it is to express natural stream programs using only for/while loops.

For instance, even very simple combinations of map/fold/filter create while loops and make it difficult to detect the loop trip count afterwards (in fact, you need an analysis just to detect that the loop terminates). If you combine several such streams with zip, the resulting code makes a nice entry for obfuscated code contests. Finally, if you use flatMap the resulting control flow doesn't fit into a for/while loop at all...

So for/while loops are not simpler than stream processing primitives and unless you explicitly introduce temporaries (i.e., inline the definition of map/fold/etc.) you quickly end up with very complicated control flow.

comment 9y ago · link · parent

Regarding extraction in Coq, there's certicoq: http://www.cs.princeton.edu/~appel/certicoq/

Granted, there's a lot of engineering work left to do, but it's moving in the right direction.

comment 9y ago · link · parent

At the assembly level, we are always working with continuation passing style. Normal calls are implemented by pushing their "return address" on the stack and then jumping to it after the procedure has finished. Formally, this is exactly a continuation.

However, all continuations here are linear (or rather affine - called at most once) and this allows you to allocate and free "closures" for your continuations with a stack discipline.

comment 9y ago · link · parent

> IMO taking the compiler out of the trusted computing base is the way to go.

That is the point of compiler verification after all.

I'm biased here, but I think that another important point is to work out what the specification of a compiler is in the first place. Obviously, we've made a poor job of communicating this for C/C++, since so many people write broken code...

comment 9y ago · link · parent

What I found after Googling is that there is a theorem by Sierpinski which shows that if we make an additional assumption about the cardinality of [R]^\omega, which seems to be approximately the same as the boolean prime ideal axiom, then there is a non-measurable set. Thus the existence of non-measurable sets is implied by principles weaker than full choice, but that's not too surprising.

The case of measure theory is particularly interesting, though, since you don't even need to change your underlying logic to get a better model. For instance, if you base your "measure theory" on valuations on locales instead of measures on sigma algebras then the theory itself becomes simpler and the Banach-Tarski "paradox" goes away.

Briefly, in locale theory, your "measure" is defined on sublocales instead of subsets. While there are more sublocales than subsets, the condition for when two sublocales are disjoint is stronger. This is what breaks the Banach-Tarski construction. The orbit subsets used in Banach-Tarski still exist, but while they are disjoint as sets, they are not disjoint as sublocales and thus don't decompose the volume of the sphere.

comment 9y ago · link · parent

What do you mean? If ZF without choice shows that a statement P holds then certainly ZFC also proves the same statement. Do you mean that there is a consistent extension of ZF with the statement "There exists a surjection from R to P(R)"?

comment 9y ago · link · parent

I was thinking about categorical probability theory or measure theory based on locales. Unfortunately there are (to the best of my knowledge) no textbooks or good writeups available for either, merely long lines of research papers. As said, it's a bit of a niche area, since most mathematicians don't want to think about reworking foundations.

comment 9y ago · link · parent

One thing which the author of this essay gets right is that contemporary mathematics is a bit dogmatic when it comes to the logical foundations. We should be looking at the Banach-Tarski theorem as evidence that a particular logical framework for reasoning about volumes/probability is more complicated than strictly necessary. Presumably no non-measurable sets exist in the "real world". At this point there are two possibilities:

- A theory with non-measurable sets is much simpler/more expressive than the alternatives and thus is still a useful tool.

- There is a simpler theory without this defect, which is at least as expressive when reasoning about real world phenomena.

In this case, the latter possibility turns out to be true. It is just unbelievably difficult to convince mathematicians to change the rules of the game, even if you can point to concrete gains.

comment 9y ago · link · parent

> In particular, one should abandon the dichotomy between conjecture and theorem.

Wasn't that the status quo before the 20th century? It's strange to suggest that working with infinite (or rather, ideal) objects is stupid. The sheer amount of progress in 20th century mathematics provides incontrovertible evidence that ideal objects are a useful reasoning tool. This is even true in combinatorics: working with generating functions is working with an algebraic structure on infinite streams...

This essay is written to incite... there is so much in there that invites comment from everyone who has ever spent five minutes thinking about these things. At the same time it is lacking in examples for ways in which a mathematical world without rigor would be better than what we have today. So instead of getting worked up about the essay itself, does anybody here have concrete examples where a lack of rigor lead to faster progress?

comment 9y ago · link · parent

A large part of any scientists job is communicating results. The people you criticize may not be novelists, but they are certainly professionals when it comes to communicating technical knowledge.

However, this knowledge is only communicated to other experts in the same - often very narrow - subfield. Often the definitions that give you a hard time when reading a paper have been refined over several years and are basically known to all other people working in the same field.

This is not ideal, but there is simply not enough manpower to produce good and generally accessible summaries of current research topics every few months...

comment 9y ago · link · parent

I agree with you in principle, but I think the problem is more one of scale than of complexity theory.

Sure the clique problem is hard to approximate in arbitrary graphs, but the graphs that appear in social networks are far from arbitrary. And indeed, in such scale free networks the clique problem becomes quasi polynomial or polynomial (http://link.springer.com/chapter/10.1007/978-3-642-35261-4_6...). Approximate solutions are also much easier to find.

On the other hand, the sheer size of Facebook's social graph means that anything other than streaming algorithms or local search is pretty much intractable. That makes solving these kinds of problems into interesting engineering challenges.

comment 9y ago · link · parent

The truth seems to be that we don't know what makes a good language. In academic research we have criteria for what makes a language expressive, and tools for analyzing existing languages and check if they allow for modular development or are fundamentally incapable of building sound abstractions.

What we don't have are answers to the "soft" questions. What makes a language pleasant to use (ignoring familiarity)? Which abstractions are easy to communicate and why or why not? What's the best way to communicate intent to a computer? It seems very unlikely that the answer should be "a text editor", but so far all alternatives have turned out to be terrible...

What's especially vexing about this is that it looks like a solvable problem. People in the social sciences have been measuring far more ephemeral phenomena, the only problem is one of funding and finding the right people to run such big and extensive experiments.

comment 9y ago · link · parent

And just to be clear, the use case where you are doing repeated lookups/traversals of a linked list is uncommon?

If not, you could always go with a hybrid implementation, e.g., using a vector with a changelog and applying the modifications only when you traverse the structure, or using some persistent sequence data structure with high branching degree. Either one would use less memory than a linked list, and frankly, I've never encountered a situation where a performance critical data structure was best implemented as a doubly linked list... The memory overhead for large structures was always prohibitive.

comment 9y ago · link · parent

As others have pointed out, the current state of the IoT market is nothing short of crazy, e.g., regarding security, device ownership, and, ironically, connectivity. I wonder if this isn't a perfect time to finally monetize the mountain of distributed OS research from the past three decades.

After all, most of you "smart sensors" are actually fairly general purpose computers, and there is no reason why you shouldn't be using all of them, all the time, for computing. Additionally, distributed OSses usually came with secure, low-overhead protocols built-in, which people in the IoT sector seem to be struggling with...

comment 9y ago · link · parent

My point is that category theory is useful for discovering nice abstractions such as algebraic effects and handlers or Monads for that matter. It's like all math, just a clever way to write/solve problems...

As for the semantics of algebraic effects and handlers, if you are not really interested I won't bore you with a long winded explanation. Suffice it to say that you can get the advantages of Eff in Haskell by using free Monads (the syntax of Eff is nicer though).

comment 9y ago · link · parent

You may want to talk to Andrej Bauer about that ;)

Specifically, the semantics of Eff involve free Monads.

comment 9y ago · link · parent

I'm not sure about non-deterministic behavior without looking it up, but you can fix this example to be implementation defined, rather than undefined like this:

  #include <stdio.h>
  
  int postincrement(int *x) { int y = *x; *x = y + 1; return y; }
  
  int main(int argc, char **argv) {
    int i = 0;
    printf("%d, %d\n", postincrement(&i), postincrement(&i));
    return 0;
  }
The point is that function arguments introduce sequence points, but the specification for i++ is weaker than what you get for a function call. C is full of gotchas like this...

comment 9y ago · link · parent

Where do you study and which subject?

In an ideal world, I would recommend people to go to university iff they want to do research level work. For everyone else, there should be on the job training and a highschool education which teaches you how to efficiently approach a new subject on your own.

In reality, the undergraduate programs take the place of a proper highschool education and businesses look to degrees for accreditation, so I think it's very dangerous to tell people that there is "no value in universities"... On the other hand, if you happen to live in a country where universities charge you tens of thousands of dollars every year, the situation is entirely different. That is crazy and everyone knows it.

comment 9y ago · link · parent

Any investment into this kind of technology is bound to have positive returns because it'll make neuroscience more effective.

Right now computational neuroscience is using a lot of blunt instruments such as electrode arrays which are implanted into mice for the duration of a few experiments before the animal is put down for ethical reasons. Safe, minimally invasive brain implants would make long term experiments a lot simpler and more ethical.

comment 9y ago · link · parent

You're right, maybe is equivalent to the type of lists with at most one element. There are however monad instances which are genuinely different.

For example the state monad is defined as

  F(X) = S -> S*X
I.e., a value of type F(X) is a state transformer which takes a state argument of type S and produces the new state and a value of type X. In this case, bind is sequencing of state transformers.

Using the state monad you can write code that looks like it uses a global variable of type S, while being completely pure which makes testing and refactoring easier, and of course doesn't pollute the rest of the program.

comment 9y ago · link · parent

What exactly are you trying to learn? Mathematical logic is a huge field in its own right, with plenty of topics that are of historical interest and a lot of active research areas.

If you want to learn modern mathematical logic you're in for a rough time, since you'll basically have to learn category theory in order to understand the few really excellent textbooks which exist (e.g. Sketches of An Elephant). If you are interested in type theory you should try reading the Homotopy Type Theory book, which is (mostly) self contained.

comment 9y ago · link · parent

The elephant in the room is that programming in English would be a huge step backwards. Modern programming languages are all about scalable, modular abstractions.

Natural language typically doesn't supply many sound abstractions. Everything you say is open to interpretation, as the many misunderstandings in this very thread clearly demonstrate...

comment 9y ago · link · parent

Your money was transferred to your account with 60% probability and donated to the Trump Foundation with 40% probability. Press escape or e to abort with 10% probability.

So uhm... More seriously, what do you mean?

comment 9y ago · link · parent

Out of curiosity, which field are you working in precisely?

In my experience (in type theory / programming languages), the main problem is that a lot of papers are just badly written. Good papers really do use precise language to be easier to digest for other people in the same field.

comment 9y ago · link · parent

In my experience this is already being practiced. Maybe it's different in machine learning, but in type theory simpler explanations are well worth publishing and are published all the time even in high impact venues.

As far as I can tell, progress towards eliminating "research debt" takes two forms: on the one hand there is a place for good exposition, typically in the form of textbooks, and on the other hand concepts get better understood over time and people come up with simpler explanations. In both cases the results can already be published...

Is the situation in machine learning really so bad that nobody is going to publish simpler explanations of known results?

comment 9y ago · link · parent

This whole situation is ridiculous. I am working in a university and I have my own office. Turns out that employees are by far the most expensive part about doing research in computer science, and the cost of giving everyone their own office is easily offset by the (noticable) increase in productivity.

Everyone I know who went on to an industry position is working in an open plan office... and it is not unusual to hear stories about people putting in a few days of home office to get some actual work done.

This is obviously anecdotal, but based on other responses in this thread and elsewhere there is more than enough evidence to justify doing a real study. It is not difficult to measure changes in productivity over time accross a sufficiently large population and the amount of money being spent on engineers means that even a marginal increase in productivity will be worth the cost.

comment 9y ago · link · parent

Your criticism is spot on. If something like Distill existed for my own research area I would applaud it, but probably not use it because of time constraints.

On the other hand, being able to write well and to create good interactive illustrations are valuable skills. Maybe we could incorporate these things into seminars or otherwise crowdsource the creation of e.g. individual figures?

comment 9y ago · link · parent

Turing gets more credit in popular culture, but academically Church is more influential. Just look at the list of Church's PhD students: http://www.genealogy.ams.org/id.php?id=8011

I have no clue why Turing became such a pop-culture icon, though...

1
456
9