Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
l_dopa
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
by
l_dopa
12y ago
Here's one way to write down the K lines example: let top_k chan k = let incr_count m l = let n = try Map.find_exn m l with Not_found -> 0 in Map.add m ~key:l ~data:(n + 1) in In_channel.input_lines chan
32.
▲
by
l_dopa
12y ago
Your comparison isn't really fair. With similar functions from Core's In_channel you can write something like: let sum_file filename = with_file filename (fold_lines ~init:0 ~f:(fun a l -> a + int_of_string l))
33.
▲
by
l_dopa
12y ago
The example is written in a strange way. You're supposed to assume x is initialized ("for most values of x"). I think it's just pointing out the difference between '&' and '&&'.
34.
▲
by
l_dopa
12y ago
Objects are far from the only way to limit access to state. Modules, lexical scope and closures, even C's static storage class all predate the current crop of OO languages.
35.
▲
by
l_dopa
12y ago
You would pass in a function or datatype containing a function, which is exactly what the OO code does. No language features beyond first class functions necessary.
36.
▲
by
l_dopa
12y ago
This approach might be why several ubiquitous languages have needlessly ambiguous grammars. Decades of writing tools to be bug-compatible with the original implementation is much harder than learning a tiny bit of theory.
37.
▲
by
l_dopa
12y ago
It's a semantics for the intermediate representation used by most of the LLVM optimization passes defined in a theorem prover. With it you can, for example, write your own LLVM pass in Coq's specification language and prove that i
38.
▲
by
l_dopa
12y ago
I think this is somewhat misleading. It's easy to give a semantics for a toy C-like imperative language. As far as I know, a semantics that is mostly faithful to the C standard becomes extremely complicated and requires modeling e.g. c
39.
▲
by
l_dopa
12y ago
Sure, and Weeks is totally correct regarding tree vs. flat representations, but I think identifying CPS with the former and SSA with the latter is misleading. The scoping discipline (respectively, dominator tree) is part of the language whe
40.
▲
by
l_dopa
12y ago
This is an area where the compiler and programming language communities often seem to be talking past each other. In the post you linked, Weeks is talking about CPS and SSA as the datastructures manipulated by optimization algorithms. CPS i
41.
▲
by
l_dopa
12y ago
Yes, this is what compelled me to comment in the first place: based on what I've read of his blog, that comparison (and his reputation in general) seems completely unjustified. There's a world of difference between this kind of sp
42.
▲
by
l_dopa
12y ago
That makes sense. If you view Haskell as a research platform, pointing out ugly corners of the type system is entirely appropriate and even helpful for people working on GHC. From the outside, for those of us that would like to see these id
43.
▲
by
l_dopa
12y ago
> A lot of Harper's comments ( and many PL theorists ) seem to completely casually gloss over the gritty compiler engineering as if it's just beneath them, and that guys like SPJ and Simon Marlow are just wasting their time wor
44.
▲
by
l_dopa
12y ago
Well, you described parametric polymorphism (a generic Nth function) and then switched to talking about dispatching on tags at runtime. You are mistaken; those really are completely unrelated concepts.
45.
▲
by
l_dopa
12y ago
You just described parametric polymorphism, which has nothing to do with objects or runtime type information.
46.
▲
by
l_dopa
15y ago
I was under the impression that algorithms are specifically not patentable http://en.wikipedia.org/wiki/Patentable_subject_matter#The_a...
47.
▲
by
l_dopa
15y ago
If there was an actively-developed common lisp implementation that also ran elisp, I would be all for running emacs on that as well. Emacs' sheer size (which you mentioned yourself) means you're not going to port it to a different language
48.
▲
by
l_dopa
15y ago
By the time we have native compilation, I hope also our Elisp implementation will be significantly faster than the one in Emacs, so it will really become attractive to people to finish the work that we have done to make the switch there.
49.
▲
by
l_dopa
16y ago
In the spirit of this brilliant experiment with direct democracy, Cantor should elect to crowdsource his next colonoscopy. We need the steady hand of the people on that endoscope, not some elitist Harvard doctor wasting taxpayer money! A
50.
▲
by
l_dopa
16y ago
Cute. If you look at the actual numbers, income distribution in the US looks a lot more like China than the EU, for example: http://en.wikipedia.org/wiki/List_of_countries_by_income_equ... That's clearly not the whole picture, but it's a
51.
▲
by
l_dopa
16y ago
This is an even worse analogy for so many reasons, not sure why it hasn't been voted down into oblivion. Must be all those people using that great new OS written in PHP.