top | item 44381825

(no title)

Scuds | 8 months ago

This being Lisa that's -2000 lines in 68k assembler. That's about as verbose as any real PL can ever get.

For what it's worth, here's quicksort in 5 lines of haskell https://stackoverflow.com/questions/7717691/why-is-the-minim...

discuss

order

kragen|8 months ago

That's not quicksort, though, because it's not in place; the actual quicksort on that page is in https://stackoverflow.com/a/7833043, which is 11 lines of code. That's still pretty concise. My own preferred concise, or at least terse, presentation of quicksort is http://canonical.org/~kragen/sw/dev3/paperalgo#addtoc_20.

How long would a quicksort (say, of integers) be in 68000 assembly? Maybe 20 lines? My 68000 isn't very good. The real advantage of writing it in Haskell is that it's automatically applicable to anything that's Ord, that is, ordered.

qsort|8 months ago

Not true quicksort though :)

That's the problem with comparing lines of code: you're comparing apples and oranges. In this case you aren't even solving the same problem.

sreekotay|8 months ago

Are... are you comparing quicksort to... Quickdraw?

Lol - ok that's genuinely funny :). slow clap

meepmorp|8 months ago

> For what it's worth, here's quicksort in 5 lines of haskell

QuickDraw was a graphics library, not a sorting algorithm

flohofwoe|8 months ago

If you think 68k assembler is 'verbose' you haven't seen x86 yet ;)