Lambdasort: Quicksort written in Python only using lambdas
lucasoshiro.github.io
Lambdasort: Quicksort written in Python only using lambdas
1–10 of 12 posts
Re: Lambdasort: Quicksort written in Python only using lambdas
#2It misses the point though that it takes a handful of lines to write Quicksort in a functional programming language as opposed to 50 or so lines in BASIC or FORTRAN 77. Of course most of us these days aren’t old enough to remember writing a Quicksort in languages like that and might not appreciate the difference but you might as well code it in assembly language as in an old language that doesn’t support recursion.
Re: Lambdasort: Quicksort written in Python only using lambdas
#3Re: Lambdasort: Quicksort written in Python only using lambdas
#4I ended up writing a little dependent type checker:
https://gist.github.com/dunhamsteve/1be0cbb346d75ee1be8f67d1...
Re: Lambdasort: Quicksort written in Python only using lambdas
#5Now that's what I call a one-liner.
Re: Lambdasort: Quicksort written in Python only using lambdas
#6Re: Lambdasort: Quicksort written in Python only using lambdas
#7Looks like the Java (balls to the walls DSL) I write when I’m just writing Java to have fun. It misses the point though that it takes a handful of lines to write Quicksort in a functional programming language as opposed to 50 or so lines in BASIC or FORTRAN 77. Of course most of us these days aren’t old enough to remember writing a Quicksort in languages like that and might not appreciate the difference but you might…
Writing it in the naive functional-like style is fun and instructive, but it doesn't quite strike at the heart of what quicksort is about.
It's an example of an instance where the functional setting makes it harder to reason about the program.
Re: Lambdasort: Quicksort written in Python only using lambdas
#8Re: Lambdasort: Quicksort written in Python only using lambdas
#9Re: Lambdasort: Quicksort written in Python only using lambdas
#10Now that's what I call a one-liner.