HNHacker News
TopNewBestAskShowJobs

procrastitron

424 karma · joined August 16, 2007

I'm a functional programming fanboy, but currently work on static-program analysis for Java. I also have a toy operating system project that I have been working on for the past few years. It's available at http://losak.sf.net, but is basically just a proof of concept right now.
submissionscomments
procrastitron··on Why do I keep writing C++?
"Why do people use emacs or vi rather than a proper editor?"

If this was meant to be tongue-in-check, then the writer really needs to do a better job of conveying sarcasm in his writing. However, if this line was meant to be taken seriously, then it displays a shocking level of ignorance regarding fundamental tools. Emacs and vi don't make editing harder, they make it significantly easier.

procrastitron··on The Y Combinator in Arc and Java
Here's the java version extended to work for various input/output types (I also renamed some things to make the code clearer):

public class Z {

    public interface Function<In,Out> {
        public Out apply(In param);
    }

    public interface RecFunction<In,Out>
        extends Function<Function<In,Out>,Function<In,Out>> {
    }

    private interface FixBody<In,Out>
        extends Function<FixBody<In,Out>,Function<In,Out>> {
    }

    public static <In,Out> Function<In,Out> fix(final RecFunction<In,Out> r) {
        return (new Function<FixBody<In,Out>,Function<In,Out>>() {
                public Function<In,Out> apply(FixBody<In,Out> f) {
                    return f.apply(f);
                }
            }).apply(new FixBody<In,Out>() {
                    public Function<In,Out> apply(final FixBody<In,Out> f) {
                        return r.apply(
                                new Function<In,Out>() {
                                    public Out apply(In x) {
                                        return f.apply(f).apply(x);
                                    }
				});
                    }
		});
    }

    public static final RecFunction<Integer,Integer> fact =
	new RecFunction<Integer,Integer>() {
	public Function<Integer,Integer> apply(
		final Function<Integer,Integer> self) {
            return new Function<Integer,Integer>() {
		public Integer apply(Integer n) {
                    if (n == 0)
			return 1;
                    else
                        return n * self.apply(n-1);
		}
            };
	}
    };

    public static void main(String[] args) {
	Function<Integer,Integer> factorial = fix(fact);
	for (int i = 0; i < 10; i++) {
            System.out.println("Factorial " + i + ": " + factorial.apply(i));
	}
    }
}
procrastitron··on OO Side Effect Free Programming
"It’s the closest to side effect free programming you can get in OO."

No, you can still have side effect free programming in OO. All of the techniques for programming without using mutable state are language agnostic and should carry over to whatever OO language you are using. You might have problems in languages that lack tail-call optimization, but even that can usually be worked around by using folds.

Now, I'm not claiming that it's feasible to make an entire app in (for instance) Java purely functional, but you can definitely build the majority of your app/library/whatever without using mutable state.

procrastitron··on Here comes the e-book revolution
Well, unfortunately I have not been able to play with many in person, just the OLPC XO and the Sony Reader. I was basing my opinion on researching them online.

The ones I've looked into whose design I preferred to the Kindle were the Iliad, the Sony Reader, the Hanlin Reader, and the OLPC XO (in e-book mode).

It's not the same category, but there are also dev kits available from e-Ink that are supposed to be suitable for building a prototype e-book reader.

procrastitron··on Here comes the e-book revolution
It's some sort of special display that was created just for the OLPC. It has an adjustable backlight. When the backlight is turned on all the way the display looks like a regular laptop display, but when it is turned off all the way, then the display looks like an e-Ink display.

Unfortunately, it does not compare with the e-Ink displays in terms of low power usage, but it is good enough for long reading sessions without straining your eyes.

procrastitron··on Here comes the e-book revolution
You're right that most laptop screen's aren't good enough for reading e-books, but the OLPC XO is an exception because of its special display. Granted, that display still isn't as nice as e-Ink, but it is good enough for serious e-book reading.
procrastitron··on Here comes the e-book revolution
I completely disagree with you regarding the Kindle's physical form; I think the Iliad (and every other e-book reader I've seen) is far ahead of it in terms of design.

When I'm reading an e-book, all I want in front of me is a large screen. However, the Kindle sacrifices screen size to make up for a built-in keyboard. 99% of the time that you are using the device you won't have any need for a keyboard, and the Iliad's 8 inch screen would serve you better at those times than the Kindle's 6 inch screen.

For me, the ideal form factor for an e-book reader would look like one of two things:

1) A larger iPod touch with something close to an 8 inch screen.

or

2) An EeePC with a swivel screen so you could use it in e-book mode, similar to the OLPC XO.

Right now I'm using an OLPC XO as an e-book reader, and although it doesn't have as nice a form factor as the Iliad or the Sony Reader, I do consider it significantly nicer than the Kindle. Of course, the low price doesn't hurt either.

procrastitron··on Ask HN: When was the last really transformational idea in programming languages?
"type inferencing as used in haskell et al, that's a fairly recent development - early 90's/late 80's?"

According to the wikipedia page (http://en.wikipedia.org/wiki/Type_inference#Hindley.E2.80.93...), it dates back to 1978

procrastitron··on Quine: A program that's only output is its own source code
Here's an interesting issue with Quines; if you release a Quine under an open source license, but only distribute the binary, does that still satisfy the rules of open source?
procrastitron··on U.S. jobless claims surge to 26-year high (highest since October 1982)
Well, yes and no. This article isn't about unemployment, it's about jobless claims. While jobless claims are tallied the way you describe, unemployment numbers are derived from a monthly poll:

http://www.bls.gov/cps/uiclaims.htm

Those numbers also probably understate the problem, but not for the reason you mentioned; the official unemployment numbers do not include people that are underemployed or those that have stopped actively looking for a job.

procrastitron··on Coding Horror: The Problem of the Unfinished Game
Actually, the strongest criticism that I've heard about the Monty Hall problem is that the game show didn't actually work like that.

I've tried explaining the problem to both people who've seen the show and those who haven't. My experience is that if you've seen the show you'll never accept the question, let alone the answer. Meanwhile, those who never watched the show can be convinced.

procrastitron··on Legislator Drafting Bill to Outlaw Non-Compete Agreements in Massachusetts
The vast majority of non-competes are not "mutually beneficial". In order to meet that qualification, the agreement would have to entail some form of compensation during the period that former employees are barred from working for a competitor.
procrastitron··on Legislator Drafting Bill to Outlaw Non-Compete Agreements in Massachusetts
California has banned non-competes for a while now, and I have yet to see any numbers indicating a mass migration of employers.
procrastitron··on Ask HN: Is my little tool doomed to obscurity?
Indeed... handingover.com seems like a good fit:

http://expired-domain.bemmu.com/d/handingover.com

procrastitron··on Why you should sell open source software
Pascal's wager only applies if you simultaneously discount the benefits of having contributors and play up the risks of clones. This seems backwards to me; it would take much less effort for someone to contribute to your project than to fork a new one. As such, you should get more contributors than competition.
procrastitron··on OLPC Resumes 'Give One, Get One' XO Laptop Sale
I'm glad to see the program being handled by Amazon this time around; hopefully that will prevent all of the distribution headaches that happened during the previous program.
procrastitron··on Video Game Consoles Up 26%; iPhone Killing Portable Gaming Devices
"However, portable gaming consoles (like the PSP and Nintendo DS) fell 14%. This clearly is an outcome of devices like the iPhone which are now full gaming systems in their own right"

This is not clear at all. The blog author is simply asserting it without providing any supporting evidence.

procrastitron··on Apple's Leopard Garbage Collector Now Open Source
I have a Lisp OS that I'm developing, and it has a real-time garbage collector.

The way it does this is that the garbage is detected using the weizenbaum variant of reference counting instead of some form of mark-and-sweep. There are a couple reasons that people tend to prefer mark-and-sweep over reference counting:

1. The reference counts have to be maintained on every assignment operation.

2. Reference counting can break if the heap-allocated memory has cycles.

The first issue is basically what you described when you asked 'is it possible to make a garbage collector that can somehow run "continually"'. The answer is yes, and the way you do that is with reference counting. However, this extra work means that you have a performance hit when compared to mark-and-sweep GCs. It's an example of the classic tradeoff between low latency and high throughput; and most applications are better off with high throughput.

The second issue is the more fundamental one, because cycles in heap allocated memory mean that the reference counts on those memory cells will never drop to zero; hence they will never be reclaimed. Most GCs that use reference counting fix this problem by also using a mark-and-sweep pass to collect cyclic data structures. Of course, this would still not be a real-time collector, so it doesn't fit my needs. Instead I changed the language to not allow cyclic data structures to be created in the first place. The way I did this was to simply make my Lisp dialect purely functional.

procrastitron··on Things I’ve learned in China so far
You can get chicken feet in the U.S. so there's no reason to guess, just go out and try it.

In my experience the taste is nothing special, but the texture is notable (the skin is fairly rubbery). More than anything, though, they are hard to eat; not much meat and not really worth the effort.

procrastitron··on Ask YC: G1, IPhone or BlackBerry?
I don't have a G-1, but I've been playing around with the emulator lately and studying the architecture, and I find it to be really impressive.

Also there does appear to be a third-party SSH app (http://code.google.com/p/connectbot/), but I don't have any experience with it.

I think that right now the IPhone is more polished. However, the G-1 is more open, so you may be better off with that in the long term.

procrastitron··on I find this startup rather disturbing...
You don't declare them in your tax return. Donations to political campaigns are not tax deductible.
procrastitron··on I find this startup rather disturbing...
Actually, they are. Or at least, if you've ever donated to any political campaign they are.

http://fundrace.huffingtonpost.com/

procrastitron··on What the author of ARC thinks about Phil Katz
It seems to have been Thomas Hart Benton speaking about John C. Calhoun:

http://books.google.com/books?id=JLpYAAAAMAAJ&pg=PA34...

And you actually got the quote pretty close to correct:

"No, sir. When God Almighty lays his hand upon a man, sir, I take mine off, sir."

procrastitron··on Writing a compiler in Ruby, bottom up
That is my experience as well, but keep in mind that the design of the source language affects this. For instance, writing a parser for C++ would be a nightmare full of bookkeeping, but a basic translation to machine code would be relatively straight forward.
procrastitron··on Nintendo makes more profit per employee than Goldman (or Google)
I think it has more to do with projected revenue growth. The big factor in stock price isn't profit, it's growth. During the past two years Nintendo's profits doubled year over year. As a result their price rocketed to ~$80/share. Now that their growth has started to stabilize, the premium paid for that growth has disappeared.
procrastitron··on Is JavaScript becoming a Ruby killer?
A strictly less powerful namespacing entity at that... If you used objects for namespaces, then you can create new ones at runtime, pass custom namespaces to different modules, and a lot of other nifty things I haven't even thought of yet.
procrastitron··on Is JavaScript becoming a Ruby killer?
Can you give some reasons you think Javascript isn't good enough for server side programming?

Certainly the language is pretty powerful, and with Rhino it's fairly easy to integrate with existing libraries.

procrastitron··on Text-Messaging Rates Come Under Scrutiny
Up until recently T-Mobile refused to let people opt-out of receiving text messages, regardless of what steps you were willing to go through. The only reason they changed their policy was because of a class-action lawsuit that was filed against them.
procrastitron··on Ask HN: Tips to work on your startup ideas while still having a day job
I don't know about hiring other people to work on it... good people will cost you and bad people will cost you even more. However, there is another alternative if you can split your design up into infrastructure and core technology; open source the infrastructure.

Obviously, the first step is to use as much existing open source code as possible, but a lot of companies will also need to do some custom infrastructure on top of that. These extensions can be a distraction, so if you can leverage the open source community to help develop/maintain them you will eliminate a huge time sink.

procrastitron··on V8 under the hood
No, the whole point is that they already wrote a compiler, so the in this case Javascript is not interpreted. You only have to bootstrap it once.

They would have had to make their compiler provide a batch compilation mode in addition to the incremental compilation mode, but that should not be a pain point. After all, batch compiling is easier to do than incremental compiling.

← PreviousPage 3 of 5Next →