HNHacker News
TopNewBestAskShowJobs

smanek

8,005 karma · joined October 10, 2007

I'm a programmer (fluent in Common Lisp, Javascript, Java, Python, and Perl). I've dabbled in Haskell, Scala, C++, and Objective-C - but still have a lot to learn about them.

I've worked on a few fun projects, including satellite defense for the DoD, a couple of big Lisp webapps, and large distributed systems.

If you need to reach me: {myusername}@gmail.com

Some of me online:

    https://github.com/smanek
    https://twitter.com/smanek
    http://arantaday.com/
My PGP Key is at http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x9526096E
submissionscomments
smanek··on Ask HN: What unknown technical blogs or sites do you read?
Unknown is relative, but here are some of the rss feeds I'm subscribed too:

http://nosql.mypopescu.com/

http://lambda-the-ultimate.org/

http://eli.thegreenplace.net/

http://www.stefankrause.net/wp/

http://mechanical-sympathy.blogspot.com/

http://www.cowtowncoder.com/blog/blog.html

http://highlyscalable.wordpress.com/

http://hunch.net/

http://perspectives.mvdirona.com/

http://www.scottaaronson.com/blog/

http://www.softwarebyrob.com/

http://blog.mikemccandless.com/

smanek··on Mona Lisa in 50 polygons, using a genetic algorithm (2008)
I did something similar around 2008: (but in Lisp!): https://github.com/smanek/ga

Had to write my own bitmap processing library, since couldn't find anything fast enough off the shelf :-D Handled alpha blending, file i/o, etc (checkout the bitmap.lisp and color.lisp files in the repo).

Here's a video of it 'evolving' a picture of John McCarthy (best individual from each generation): http://www.youtube.com/watch?v=-_VFZ_ON0A8

And here it is doing the Mona Lisa: http://www.youtube.com/watch?v=S1ZPSbImvFE

smanek··on Mary Meeker Says We're Giving Up Our Possessions for the Internet
http://money.cnn.com/magazines/fortune/fortune_archive/2001/...

She's often considered the face of the irrational exuberance behind the first dot com boom/bubble.

Rating many companies that subsequently lose 90-100% of their market cap as 'strong buys' is a pretty scary track record. IIRC, her portfolio of 'outperforms-or-better' lost ~80% of their value in one year.

Granted that the 'market can remain irrational longer than you can stay solvent', etc so she may not deserve all the scorn heaped on her (I haven't done the research to know ...)

smanek··on Reddit Considering Accepting Bitcoin
If a lay person were to ask how they get back their dollars if they are stolen from their wallet, say due to a person mugging them, what do you tell them?
smanek··on RedisToGo is now offering Redis Hosting in AWS US-West-2
A disk seek (e.g., if you have more data than RAM and are using virtual memory) might take ~10ms. A packet round trip within the same AZ in EC2 is <0.5ms.
smanek··on How to get your IP unbanned on HN
Just to clarify, it will definetly take me more than a day to write/profile/test the changes (especially since I'll be learning arc in the process).

My hope is that it will only take a day or so to deploy it, once it's ready.

smanek··on How to get your IP unbanned on HN
pg: I have fair bit of lisp dev experience. If, as a weekend project, I modified the HN src to use postgres and memcache would you consider using it in production? Obviously, I don't expect carte blanche prior agreement, but I wouldn't want to invest the time unless I thought it was plausible the work could actually help.

I would expect it to solve most of your performance problems for the foreseeable future (at the very least, by letting you scale horizontally and move the DB, frontends, and memcaches to separate boxes - plus ending memory leaks/etc by moving most of the data off the MzScheme heap).

The obvious downside is that it would use your (or someone at YC's) time. First to merge the changes I make to http://ycombinator.com/arc/arc3.tar into the production code, then to buy/setup some extra boxes and do the migration. We're probably talking, roughly, a day. It also has the unfortunate side effect of costing HN's src some of its pedagogical value, since it adds external dependencies and loses 'purity'.

Been looking for an excuse to learn arc for a while now ...

smanek··on Degrowth
I think so.

On a several decades/century scale it's worthwhile to funnel at least a few percent of GDP into basic science research[1]. But, in any given quarter/year, it's almost certainly a net loss. The trick being that every few decades, you'll get nuclear power, the transistor, etc[2].

Or, as a 'local' example: non-trivial number theory had basically no benefit for centuries but humanity kept 'investing' resources into it - which a short term optimizer wouldn't. Then, cryptography came along and it suddenly 'paid' for the entire field a dozen times over.

[1]: Research is sort of like early stage VC - but with funds that pay out over 70 years instead of ~7.

[2]: I would love to write about many more examples in much more depth, but will omit for the sake of brevity. I roughly feel like the newtonian mechanics was directly responsible for the industrial revolution, relativistic physics for the nuclear age, quantum mechanics for the computer age (with similar analogues in the biological sciences).

smanek··on Diffie: Don't secure the internet, it needs crime
http://en.wikipedia.org/wiki/Parable_of_the_broken_window
smanek··on MIT Lectures on Advanced Data Structures (6.851)
The ones on memory hierarchy (cache oblivious algos, etc)
smanek··on The software development final exam: Algorithms and Data Structures
For algo/datastructures, CLRS (http://www.amazon.com/Introduction-Algorithms-Thomas-H-Corme...) is the gold standard.

For OS's, Tanenbaum (http://www.amazon.com/Modern-Operating-Systems-Andrew-Tanenb...) is popular.

'Math' is broad - if I can recommend only one book to cover all of Math I'd probably say 'The Road to Reality' (http://www.amazon.com/The-Road-Reality-Complete-Universe/dp/...). More practically (for the subset of math most programmers are likely to care about), you'll do fine with one good discrete math book and one linear algebra book. Throw in one each on Stats, Abstract Algebra, Calc (up to ~diffeq), and Real Analysis (in roughly that order) if you're a bit more ambitious ;-)

smanek··on Racism at a gaming company
also offtopic: 'voracious vocabulary' probably doesn't mean what you think ;-) (you're probably thinking 'voracious reader')

I like to use HL Mencken as inspiration.

smanek··on Dan Weinreb passed away
Dan was awesome. A few years ago, when I was an undergrad trying to raise money for my first startup in Boston, he was a huge help. Took the time to grab a couple meals with me and explain how things worked, introduced me to angels, and was really insightful. He had no expectation of anything in return - just gave freely of his time and experience.

I wish I had kept in better touch with him. He will be missed.

smanek··on PwdHash
My per-site hash is only salted with the site's name. Hence, there is no state stored on my machine.

Personally, I use (and prefer) LastPass to this approach.

smanek··on Google Street View: A wolf in sheep’s clothing
Actually, Google Translate was an enormous leap forward in machine translation quality. It won a number of awards for its astonishingly good performance. And its design premise is that you can use really simple algorithms if you have crazy amounts of training data (a then controversial approach called 'statistical machine translation' - as opposed to rule/grammar based).

Look at Norvig (Google's head of research, and AI-demigod) at al's paper "The Unreasonable Effectiveness of Data."

smanek··on Scripted.com API: Interactive Documentation
Woah - I've used those docs dozens of times and never realized that the demos were interactive. I just assumed they were static examples. Thanks!
smanek··on Why you should ALWAYS CC someone
http://en.wikipedia.org/wiki/Bystander_effect
smanek··on Feynman: I am burned out and I'll never accomplish anything
Use the Google, Luke.

The first hit on searching for the quote explains its history: http://quoteinvestigator.com/2010/08/27/master/

smanek··on YC Facelift: Pebble
tip: the original meaning of a word doesn't necessarily have any relation to it's current meaning. I assume you didn't know about the etymological fallacy (http://en.wikipedia.org/wiki/Etymological_fallacy) when you used it. Now you know!

Seriously, stop being overly PC. You're just being annoying.

smanek··on Go: Severe memory problems on 32bit Linux
I don't think any GC scheme could work with that. Languages that allow pointer arithmetic like that basically can't be GC'd.

The problem with an imprecise GC is that having an integer that looks like a pointer, could prevent an object from being freed.

smanek··on Go: Severe memory problems on 32bit Linux
There was some back-and-forth between Zed Shaw and DHH that I remember being interested by at the time. Zed deleted all his posts - but here are some places to get started:

- Shaw's opening volley: http://web.archive.org/web/20080103072111/http://www.zedshaw... [lots of stupid personal flames - but his technical points are consistent with what I remember from the time]

- DHH's response: http://david.heinemeierhansson.com/posts/31-myth-2-rails-is-...

- I can't find a copy of shaw's actual response, but here's the relevant HN thread: http://news.ycombinator.com/item?id=364659

The salient point (quoting Zed):

"""

Now, DHH tells me that he’s got 400 restarts a mother fucking day. That’s 1 restart about ever 4 minutes bitches. These restarts went away after I exposed bugs in the GC and Threads which Mentalguy fixed with fastthread (like a Ninja, Mentalguy is awesome).

If anyone had known Rails was that unstable they would have laughed in his face. Think about it further, this means that the creator of Rails in his flagship products could not keep them running for longer than 4 minutes on average.

Repeat that to yourself. “He couldn’t keep his own servers running for longer than 4 minutes on average.”

"""

I've never been much of Ruby/Rails guy - but my understanding is that everyone had to restart Rails a few times an hour cause the memory leaks were so bad in those days.

smanek··on Go: Severe memory problems on 32bit Linux
Yep, that's basically it.

It sounds crazy (and it is!) - but it often works reasonably well in practice. SBCL (one of the most performant Common Lisp implementations) has an 'imprecise gc' that works the same way - and I've seen reasonably heavily stressed processes with uptimes in the weeks/months.

Remember, even a few years ago (before fastthread, etc) a reasonably loaded Ruby on Rails app couldn't stay up for more than ~10 minutes w/o memory leaks forcing a restart (DHH said 37Signals as doing ~400 restarts/day per process, IIRC) because the runtime was such a piece of crap. Yet, many people still used it to solve real problems and make real money.

At least Go's memory leaks are much slower than Ruby's ;-)

smanek··on Is Java the platform of the future?
Hotspot is the most commonly used JVM impl I was referring to. Last I looked into it (probably a year ago), some of the graphics libraries it includes weren't open source - but everything important (including the JIT) is.

The patent issues are regarding Dalvik AFAIK, so I don't see how it's relevant to this discussion ... (although, from what I've heard, it seems like Oracle's being a jerk ...)

If you think that a general purpose language has to be able perform as well as C without calling native code (JNI, FFI, etc), I guess I'd have to agree Java isn't 'general purpose' . But I'd contend neither are Python, Ruby, Erlang, Javascript, etc under that definition. Therefore, that's probably not the right definition, since it excludes most general purpose languages ;-)

Being able to synchronize on any object is actually really efficiently implemented (8 bytes of Object overhead total, neat optimizations like biased locking, etc). And, if you don't want to share state between threads, Java can do pretty clean actors/message passing (http://doc.akka.io/docs/akka/2.0/java/untyped-actors.html) or transactional variables (AtomicRefs are built in). Java concurrency does give you the ability to shoot yourself in the foot if you use it wrong, but so will any sufficiently powerful tool.

Re the JVMs support for FP:

- JVM7 added an InvokeDynamic instruction which I believe addresses your polymorphism concerns.

- It sucks that there isn't a bytecode instruction to allow TCO. But, in practice, many JVM languages will convert recursion to iteration at compile time with constructs like http://clojure.org/special_forms#Special%20Forms--(recur%20e...

- What do you mean by 'fast object allocation'? I'm not familiar with the term ... Creating objects is fairly fast in Java though. A quick test suggests I can alloc around 200 million objects per second on the heap once the code path is JIT'd on my laptop. Incidentally, it's surprisingly tricky to fool the JVMs escape analysis and force a heap (not stack) allocation, without introducing too much extra work in a microbenchmark ;-).

- AFAIK, you're right that closures require an object allocation - but how else would you do it? When I was writing Common Lisp, we had to avoid creating closures in tight loops for the same reason

smanek··on Is Java the platform of the future?
I think Java is a pretty bad language, but most of your points are provably wrong. You're either grossly misinformed (some of what you say was true about a decade ago, but hasn't been since around the 1.5 release in ~'04) or purposefully spreading lies.

You're factually wrong about the open-source thing: the primary impl of Java is open source (http://hg.openjdk.java.net/jdk7u/jdk7u). Sure, some impls like Azul might not be - but that's the joy of an Open language with a real spec, anyone can write an impl under any license they choose.

The claim that Objects have 'too much' overhead is subjective - but also basically wrong. Generally Objects in Java have 8 bytes of straight book-keeping overhead, plus padding to get the size of the fields to the nearest multiple of 8 bytes. That's expensive relative to C, but cheap compared to almost any other object oriented, GCd language (and can often be avoided via primitives, escape analysis, etc). For reference, CPython (the main Python impl) has ~30 bytes of overhead on an Int between tag bits, book keeping, etc last time I investigated.

How do you think the Java concurrency model is flawed? Almost any concurrency model I can think of, from Erlang-style message passing (see: Akka) to the new Fork/Join framework can be implemented in Java since its concurrency primitives are complete. I've even done basic impls of STM on AtomicRefs. Frankly, Java has one of the better defined and fine-grained concurrency models I know of. C++ just got a well-defined memory model in the '11 standard IIRC (vs '04 for the JVM).

I'm with you on the functional programming thing - syntax on anonymous inner classes and a lack of type inference make it way too verbose. But it's (largely) fixed via Project Lambda in Java 8. And, in the meantime, there are plenty of great JVM languages (Scala, Clojure, etc) with better support.

smanek··on 99Dresses (YC W12) wants to give women an infinite closet
http://www.renttherunway.com/ has been doing something similar (high-fashion dress rentals) for a few years now. Of course, Rent The Runway is more centralized - it's more analogous to a hotel, while 99 Dresses is more AirBnB.
smanek··on Peter Sunde: We need cash for anonymous transactions
Where does applied crypto talk about anonymous currency?

I read Cryptography Engineering (its successor) last year, and don't think I remember anything about that ...

I'm sure it discusses standard public key crypto, but it's a huge leap to go from that to a truly anonymous digital currency. Even with blind signatures it's really hard to prevent the 'bank' from maintaining an audit trail. My understanding is that even Bitcoin maintains an auditable transaction trail, so it's still not as good as cash.

PS: s/diety/deity/

PPS: I'd consider it bad form to use an affiliate amazon link there

smanek··on Why I like lots of languages, and Go is pretty neat too
I'm the author of the 'Why I don't want to use Go' post you're talking about.

I think you definitely should learn Go! I spent a few days using it when it first came out, and there are a lot of neat ideas that are worth learning about. I just can't think of a problem that would make me want to use it in production.

FWIW, the HN title was (incorrectly) 'Why I don't want to Learn Go'. I used that title for an unpublished first draft, but s/learn/use/ before making it public. Posterous seems to still be using the old (unpublished) title as the URL (http://arantaday.com/why-i-dont-want-to-learn-go), which is probably where the submitter got the wrong idea from.

smanek··on Why I Don't Want to Learn Go
It's different, because I'm saying that much system level work has to optimize by not using a garbage collector. I've literally implemented off-heap malloc()/free() in Java because GC is so untenable.

I argue that makes a language with has a GC that you can't avoid (as far as I know, it's impossible to allocate an 'object' off-heap in Go) a fairly poor choice for much system level work.

Which means, if Go is to find a niche, it's got to be at a 'higher-level.' And that requires competing more directly against Java or Python - a much higher bar than trying to be better than C.

smanek··on Why I Don't Want to Learn Go
That's fair - the largest code bases I've ever worked on are all less than ~200K LOC.

They've enforced style by mandating committers hook a linter into a git pre-commit hook, and compilation time hasn't been a huge problem since the languages always support incremental/partial compilation (Java/Lisp for the most part).

I can imagine that not working at Google-scale.

smanek··on Why I Don't Want to Learn Go
Do you seriously doubt that the Go GC is significantly worse than the Oracle JVM GC (by the metrics of pause times and throughput)? I don't think I've ever heard anyone suggest that it isn't.

My point with this article is simply that, even if Go's GC catches up to the JVMs (which would be an amazing accomplishment in itself), it would still be too inefficient for serious systems work. I provided several real-world examples to that effect.

If you want benchmarks, check out the numbers from moving some of the critical allocations off heap (and out of the GCs reign) in the Java HBase project: http://www.slideshare.net/cloudera/hbase-hug-presentation

Page 1 of 31Next →