HNHacker News
TopNewBestAskShowJobs

primodemus

1,476 karma · joined December 26, 2009

submissionscomments
primodemus··on Of Lisp Macros and Washing Machines
"Wadler created ML to help automate proofs". Minor nitpick: actually, ML was designed by Robin Milner: http://en.wikipedia.org/wiki/ML_(programming_language)
primodemus··on Java.next() - Scala: The Revenge of the Static Typing
CLU comes to mind. http://en.wikipedia.org/wiki/CLU_programming_language

A hello world sample: http://hopl.murdoch.edu.au/showexample.prx?exp=59

primodemus··on Stop Telling Students Recursion is Hard
Robert Harper from CMU, eloquently expresses the same notion: "One of the classic pitfalls of teaching recursion is to try to explain it by referring to some mysterious entity called a “stack” that is absolutely invisible in the program you write. There’s a long song and dance about “frames” and “procedure calls” and “pushing” and “popping” things on this “stack” of which the professor speaks, and no one understands a damn thing. It all sounds very complicated, and impressive in a way, but if there’s one thing people learn, it’s to stay the hell away from it! And in doing so, students are robbed of one of the most powerful and useful programming tools available to them, the key to writing clean, reliable code". more: http://existentialtype.wordpress.com/2011/03/21/the-dog-that...
primodemus··on Red Hat's top secret Java Killer/Successor: The Ceylon Project
The statement: F(G<A, B>(7)); could be interpreted as a call to F with two arguments, G < A and B > (7). Alternatively, it could be interpreted as a call to F with one argument, which is a call to a generic method G with two type arguments and one regular argument.

See the C# specification section 9.2.3 (grammar ambiguities) for more details: http://www.ecma-international.org/publications/files/ECMA-ST...

primodemus··on A Quick Look at the Rust Programming Language
Since Rust implements a typestate system, here is a link to the classic 1986 paper by Strom and Yemini which introduces the concept of typestate: http://www.cs.cmu.edu/~aldrich/papers/classic/tse12-typestat...

LtU has a thread on Rust: http://lambda-the-ultimate.org/node/4009

primodemus··on LinearML:a programming language designed to write efficient parallel programs.
The tutorial contains a nice overview of the language: https://github.com/pika/LinearML/wiki/Tutorial

The most interesting feature is the use of linear types to statically ensure sound usage of resources, including memory, in other words, no garbage collector.

primodemus··on TeX Is Great, What Is TeX?
According to the following extract from 'Coders at Work', Knuth wrote the first version of Tex using pencil and paper:

Seibel: Speaking of practical work, in the middle of working on The Art of Computer Programming you took what turned into a ten-year break to write your typesetting system TeX. I understand you wrote the first version of TeX completely away from the computer.

Knuth: When I wrote TeX originally in 1977 and ’78, of course I didn’t have literate programming but I did have structured programming. I wrote it in a big notebook in longhand, in pencil. Six months later, after I had gone through the whole project, I started typing into the computer. And did the debugging in March of ’78 while I had started writing the program in October of ’77. The code for that is in the Stanford archives—it’s all in pencil—and of course I would come back and change a subroutine as I learned what it should be. This was a first-generation system, so lots of different architectures were possible and had to be discarded until I’d lived with it for a while and knew what was there. And it was a chicken-and-egg problem—you couldn’t typeset until you had fonts but then you couldn’t have fonts until you could typeset. But structured programming gave me the idea of invariants and knowing how to make black boxes that I could understand. So I had the confidence that the code would work when I finally would debug it. I felt that I would be saving a lot of time if I waited six months before testing anything. I had enough confidence that the code was approximately right.

Seibel: And the time savings would be because you wouldn’t spend time building scaffolding and stubs to test incomplete code?

Knuth: Right.

primodemus··on A Physicist Experiments With Cultural Studies (1996 hoax)
Relevant: Richard Dawkins' review of 'Intellectual Impostures' by Alan Sokal and Jean Bricmont

http://richarddawkins.net/articles/824-postmodernism-disrobe...

primodemus··on Reasons to use Haskell as a Mathematician
I think sigpfe is talking about corecursive definitions, which can produce infinite data structures: http://en.wikipedia.org/wiki/Corecursion
primodemus··on Doron Zeilberger on computer-assisted proofs
His "Opinion 37: Guess What? Programming is Even More Fun Than Proving, and, More Importantly It Gives As Much, If Not More, Insight and Understanding" is also very interesting: http://www.math.rutgers.edu/~zeilberg/Opinion37.html

Fun fact: Doron is known for crediting his computer "Shalosh B. Ekhad" as a co-author.

primodemus··on Developer only event at SXSW (code puzzle gets harder with more tweets)
C#: data.GroupBy(i => i).Where(g => g.Count() > 1) .Select(g => g.Key) .ToList().ForEach(x => Console.WriteLine(x));
primodemus··on Disciple: A Strict Dialect of Haskell
According to Sabry's criteria for pure languages: 1. it is a conservative extension of the simply typed λ-calculus. 2. it has a well-defined call-by-value, call-by-need, and call-by-name evaluation functions (implementations), and 3. all three evaluation functions (implementations) are weakly equivalent.

Disciple is pure. This is argued in the first chapter of Ben Lippmeier's thesis: http://www.cse.unsw.edu.au/~benl/papers/thesis/lippmeier-imp...

primodemus··on How do we tell truths that might hurt? (Edsger W.Dijkstra)
"APL is a mistake, carried through to perfection. It is the language of the future for the programming techniques of the past: it creates a new generation of coding bums."

Interesting discussion of why Dijkstra hated APL so much: http://www.mail-archive.com/chat@jsoftware.com/msg00137.html

primodemus··on My Company Is Using OCaml for web development. Why?
According to Yaron Minsky (Jane Street Capital), yes: "One of the things we noticed very quickly when we started hiring people to program in OCaml was that the average quality of applicants we saw was much higher than what we saw when trying to hire, say, Java programmers. It’s not that there are not really talented Java programmers out there, there are. It is just that for us, finding them was much harder. The density of bright people in the OCaml community is impressive and it shows up in hiring, when reading the OCaml mailing list, and when reading the software written by people in the community. That pool of talent is probably the single best thing about OCaml from our point of view".

More: http://www.janestreetcapital.com/minsky_weeks-jfp_18.pdf

primodemus··on Dependency Injection is dangerous for your career
The following is a comment from Frank Atanassow on a LtU discussion about the Curry Howard correspondence:

blah blah blah dependency injection blah blah blah (This is a bit off-topic, but it came to mind, so what the hell.) You are correct in your observations that given most programming languages (even those such as Haskell), it is difficult to see exactly how Curry-Howard is useful. I recently stumbled across someone mentioning something called "dependency injection". I didn't know what it was, so I googled (I guess this is lowercase nowadays!) it and read Martin Fowler's article on it. It is a bit on the long side, and I kept waiting for the punch-line; you know, the point at which the author hits you with the insight which justifies the preceding verbosity and the hi-tech-sounding name ("dependency injection" — I can't help but think of "fuel injection", and gleaming motor engine showcases), but it seemed indefinitely postponed. And in the end, it turned out that "dependency injection" just means "abstraction" specifically by parametrization, by update and by what I think amounts to type abstraction plus update. (Apparently these are called — I kid you not — type 3 IoC, type 2 IoC and type 1 IoC...!) To me this all seemed rather obvious and it got me thinking about why it isn't obvious to the author or his readership. In Haskell, if I am given some type B which I need to produce somehow, and I realize that the B-values I need depend on some other values of type A, the first thing I do is write down "f :: A -> B". Then I write down "f a =", and then I start writing stuff after the equals sign until I have what I need. I do that because I know once I have the type that if there is an inhabitant of the type "A -> B" it can be expressed as "\a -> b" for some b, so the "f a =" part is always part of my solution and I will never have to change that unless I want to. So once I've written that down I feel one step closer to my solution. I know that for three reasons. First, because of my experience as a functional programmer. Second, because it is part of the universal property of exponentials ("factors uniquely"), that is, of function types. And third, because by the Curry-Howard correspondence with natural deduction, I can start any proof of A which depends on B by assuming A, that is, adding it as a hypothesis. So, why is it so obscure in Java? I think part of the reason is that in Java you have update, so there are complications and additional solutions. But part of the reason is also that it largely lacks structural typing, and that makes it hard to see that a class('s interface) is a product of exponentials. (With nominal typing, you tend to think of a class by its name, rather than its structure.) You could also blame the syntax of method signatures, which obscure the relationship with exponentials and implication. But is the syntax the cause or just a symptom? (You know what I think about syntax...) If CH could be readily applied to Java, perhaps Java's designers would have chosen a more suggestive syntax. But even if they had decided to stick anyway with C-style syntax, the idea of using abstraction to handle dependencies would have been more obvious.

More: http://lambda-the-ultimate.org/node/1532

primodemus··on Brutal New York - 1965/95
yes it has been disputed. See: http://online.wsj.com/public/article/SB113314261192407815-HL...

and http://www.economist.com/node/5246700?story_id=5246700

primodemus··on Introduction to Logic in Computing Science [pdf]
The text uses Mizar, a formal language based on Tarsky-Grothendiek set theory for expressing and checking its proofs: http://mizar.org/system/
primodemus··on What is a functional programming language?
If we define a functional language as a language based on the lambda calculus, then whether it has first-class functions or not is not completely orthogonal since functions are values in the lambda calculus.
primodemus··on The PHP strtod() denial of service bug
He also points to Compcert: a certified compiler for a subset of C. The compiler is specified, programmed and proved in Coq. It is a really impressive project: http://compcert.inria.fr/compcert-C.html
primodemus··on Real World F#
F#'s type system supports units of measure. It looks really nice: http://blogs.msdn.com/b/andrewkennedy/archive/2008/08/29/uni...
primodemus··on Martin Odersky on the Future of Scala
"But in fact, in the end result the Scala collection libraries are actually unique, nobody, no other language has a library like that, where you say you have a rich set of collection types, a rich set of collection operations, in particular bulk operations, that take function parameters like Map, Filter, Flat Map, these sort of things and you have the uniform return type principle which says that every operation can be applied on a collection and yields the value of the same collection as a result. So if you apply a map to a set, you get a set, if you apply a map to a sequence, you get a sequence. "

Anyone knows how Scala's collections compares to C#'s linq?

primodemus··on Proofs By Contradiction And Other Dangers
Regarding the principle that a forall exists statement of arithmetic can be translated to one without contradiction, the paper linked right next to your quote is basically a procedure to extract computational evidence from a clasical proof, using a translation based on the kolmogorov interpretation: http://en.wikipedia.org/wiki/Brouwer%E2%80%93Heyting%E2%80%9...

Terry Tao has a nice article comparing common proofs by contradiction to its contrapositive versions: http://terrytao.wordpress.com/2010/10/18/the-no-self-defeati...

primodemus··on Video lecture series on programming languages and formal reasoning
Relevant thread on LtU: http://lambda-the-ultimate.org/node/492
primodemus··on Why Lisp is a Big Hack (And Haskell is Doomed to Succeed)
Benjamin Pierce has a course on the mathematical theory of programming languages, using the Coq Proof Assistant:

http://www.cis.upenn.edu/~bcpierce/sf/toc.html

Adam Chlipala's 'Certified Programming With Dependent Types' is a textbook about practical engineering with the Coq proof assistant. The focus is on building programs with proofs of correctness, using dependent types and scripted proof automation:

http://adam.chlipala.net/cpdt/

primodemus··on Why you don't need the Y combinator in Perl 6
how can I use this when coding mutually recursive functions?
primodemus··on No more "minimal early Lisps", pulleezz
from the r6rs spec: http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-8.html#node_cha...
primodemus··on The Ulam spiral: hidden structure among the prime numbers
Arthur C. Clarke described the prime spiral seven years before it was discovered by Ulam in his 1956 novel 'The City and the Stars': "Jeserac sat motionless within a whirlpool of numbers. The first thousand primes, expressed in the binary scale that had been used for all arithmetical operations since electronic computers were invented, marched in order before him. Endless ranks of 1's and 0's paraded past, bringing before Jeserac's eyes the complete sequences of all those numbers that possessed no factors except themselves and unity. There was a mystery about the primes that had always fascinated Man, and they held his imagination still. Jeserac was no mathematician, though sometimes he liked to believe he was. All he could do was to search among the infinite array of primes for special relationships and rules which more talented men might incorporate in general laws. He could find how numbers behaved, but he could not explain why. It was his pleasure to hack his way through the arithmetical jungle and sometimes he discovered wonders that more skilful explorers had missed.

He set up the matrix of all possible integers, and started his computer stringing the primes across its surface as beads might be arranged at the intersections of a mesh. Jeserac had done this a hundred times before and it had never taught him anything. But he was fascinated by the way in which the numbers he was studying were scattered, apparently according to no laws, across the spectrum of the integers. He knew the laws of distribution that had already been discovered, but always hoped to discover more."

primodemus··on Omega programming language
talk about raw power... here is a ray tracer in the K (a programming language from the apl family): http://www.nsl.com/k/ray/ray.k
primodemus··on Omega programming language
your first link points to Tim Sheard's Omega, a dependently typed programming language. Dependent types allow the programmer to codify arbitrary invariants in the types of the expressions. Some notes on depend types: http://axisofeval.blogspot.com/2010/10/notes-on-dependent-ty...
primodemus··on Starting Forth - After yesterday's Prolog post, another awesome language
Minimal FORTH compiler and tutorial : http://www.annexia.org/forth Lambda the Ultimate thread: http://lambda-the-ultimate.org/node/2452
← PreviousPage 2 of 3Next →