fadmmatt's comments

fadmmatt | 16 years ago | on: The Derivation of Y Combinator

The role the YC plays in this case is hiding the memoization.

The memoizing Y combinator is the same as the Y combinator, except it doesn't re-compute inputs it's already seen.

Writing recursive functions in "Y-combinator style" is a way to expose internal recursive call sites to external inspection and manipulation.

The Y combinator version still grows the stack.

fadmmatt | 16 years ago | on: Do you have a blog? And if so, why?

Yes.[1]

I do research in programming languages, but until yesterday, I never posted much about my research area.

I use my blog to post on topics related to courses I teach. (Mostly advanced compilers and static analysis.)

I also post on new ideas from others that I don't have time to do original research in, but that I find useful or interesting.

I'm also using my blog to recruit students for our Ph.D. program. It worked pretty well for that this year.

[1] http://matt.might.net/articles/

fadmmatt | 16 years ago

Just curious where you got the number $500,000

I've heard ballpark estimates that the total wealth of the U.S., the sum of all assets (bridges, buildings, companies, cars) minus debts is roughly $80-$90 trillion. Wikipedia seems to think it's nearer to $60 trillion.

Assuming $90 trillion and 300mil people, if we divided up the wealth of everyone (not just the top 1%) and redstributed, we'd only get to $300,000 per person. If the top 1% hold a third of all wealth, you've got at most $100,000 per person.

fadmmatt | 16 years ago | on: Ask HN: How viable is it for a programmer to switch to a DVORAK keyboard layout?

In my experience, yes.

I switched to Dvorak a couple years ago, and I've been glad I did. I used to have terrible pain in my wrists and forearms. For eliminating pain, switching to Dvorak was as effective as switching to an expensive ergonomic keyboard.

I went cold turkey, so I felt like a stroke patient for the first four days. It was a very awkward and frustrating feeling. Within a week, I could type fast enough to code. (Coding doesn't require a fast typing speed.) It took about two weeks to get back to email/IM speed.

I'm probably not as fast as I was at QWERTY (110 wpm -> 90 wpm), but I'm certainly fast enough. If I do 15 years on Dvorak, I'll probably reach 110 wpm again.

I'd recommend doing an hour of typing exercises each day, and napping after each exercise to let it sink in. Each time I woke up from a nap, I was much better at the exercise from before the nap.

I wrote up my experience on my blog if you're interested:

http://matt.might.net/articles/preventing-and-managing-rsi/

fadmmatt | 16 years ago | on: Ask HN: What languages used to write computer languages?

For implementing languages, I highly recommend Scheme, Haskell and Scala.

These languages are hell-on-wheels for tearing apart and transforming syntax trees.

I teach a compilers class, and I encourage my students to use a mixture of Scala and Scheme. If you're thinking about implementing a language, you might want to look at some of the blog posts I wrote for my students:

* A Scheme interpreter in Scala: http://matt.might.net/articles/denotational-interpreter-for-...

* A meta-circular Scheme interpreter: http://matt.might.net/articles/metacircular-evaluation-and-f...

* Compiling Scheme to C: http://matt.might.net/articles/compiling-scheme-to-c/

* Compiling Scheme to Java: http://matt.might.net/articles/compiling-to-java/

* Architectures for interpreters: http://matt.might.net/articles/writing-an-interpreter-substi...

fadmmatt | 16 years ago | on: Java Closures after all?

Don't forget that Java already has anonymous classes, which can be used to mimic closures.

I taught my advanced compilers class how to compile Scheme directly to Java by using them to implement lambda:

http://matt.might.net/articles/compiling-to-java/

In fact, as the link above points out, anonymous classes are flexible enough to express the Y combinator, allowing "recursion-less recursion" in Java.

fadmmatt | 16 years ago | on: Lisp in about 200 lines of Ruby

The lambda calculus is Turing-complete, so the following language is sufficient to encode any computable function:

exp ::= var | (lambda (var) exp) | (exp exp)

Check out

http://matt.might.net/articles/church-encodings-demo-in-sche...

To see how to build numbers, booleans, lists, conditionals and recursion out of pure lambdas.

Even cooler is that these tricks work in languages like JavaScript too:

http://matt.might.net/articles/implementation-of-recursive-f...

page 2