News for hackers. Stuff that matters.
Re:A spreadsheet in fewer than 35 lines of Tcl/Tk, no librar... by beagle3 on Friday March 27, 2015 @09:17AM (#9276032)
Obligatory K reference: 2 line spreadsheet implementation.

    S..t:".[`D;(;);{. y};S[]];S[.;`f]:9$D[]"
    S:D:.+(`a`b`c`d;4 6#,"")
This is for K v2 which had Web+JS style built in native GUI. Later versions (K3 =~ Kona, k4/q and the upcoming k5) have dropped the GUI, so unless you have a K2 interpreter lying around, you can't test it. But rest assured it did work on a standalone 200KB interpreter that runs on a bare Win32 or Linux/Solaris + X install.

More info in http://nsl.com/papers/spreadsheet.htm - look for S- near the bottom.

Re:A spreadsheet in fewer than 35 lines of Tcl/Tk, no librar... by ColinWright on Friday March 27, 2015 @05:21AM (#9275306)
A friend of mine wrote a mouse-driven spreadsheet in a single line of BBC BASIC. Tokenised, it was less than 254 characters. No load or save capability, but full formulas and cell references, and demand-driven recalculation.

I should find, reformat, annotate, and re-implement it. If only I had the time. One day.

Re:A spreadsheet in fewer than 35 lines of Tcl/Tk, no librar... by IgorPartola on Friday March 27, 2015 @06:16AM (#9275425)
I wanted to write a short computer program but didn't have te time?
Re:A spreadsheet in fewer than 35 lines of Tcl/Tk, no librar... by asQuirreL on Friday March 27, 2015 @06:38AM (#9275496)
The length of the program isn't necessarily correlated with the amount of time it takes to write it, or more importantly, understand it ;)
Re:A spreadsheet in fewer than 35 lines of Tcl/Tk, no librar... by micheljansen on Friday March 27, 2015 @06:48AM (#9275522)
I believe that's the joke:

"I wanted to write a short computer program but didn't have the time (so I wrote a long program instead)".

Re:A spreadsheet in fewer than 35 lines of Tcl/Tk, no librar... by konmik on Friday March 27, 2015 @07:57AM (#9275732)
It is not a joke. Optimization takes time.
Re:A spreadsheet in fewer than 35 lines of Tcl/Tk, no librar... by IgorPartola on Friday March 27, 2015 @09:52AM (#9276233)
As the foremost domain expert on the subject (the subject being what I meant by my own comment), I can say with 100% certainty that it was in fact a joke, or rather a poor attempt to paraphrase Mark Twain's: "I didn't have time to write a short letter, so I wrote a long one instead."

Of course you are right, optimization does take time, whether you are optimizing a computer program or a letter.

Re:A spreadsheet in fewer than 35 lines of Tcl/Tk, no librar... by dang on Friday March 27, 2015 @01:46PM (#9277867)
Not Twain, Pascal: http://quoteinvestigator.com/2012/04/28/shorter-letter/.

But yes—just as applicable to computer programming as letter writing.

Re:A spreadsheet in fewer than 35 lines of Tcl/Tk, no librar... by Igglyboo on Friday March 27, 2015 @02:33PM (#9278205)
It is a joke.

Things that are shorter or smaller generally take less time to produce than things that are longer or larger, it's a joke because the opposite is true in this case. Jokes can be true statements as well as falsehoods.

Re:A spreadsheet in fewer than 35 lines of Tcl/Tk, no librar... by ximeng on Friday March 27, 2015 @06:22AM (#9275444)
https://news.ycombinator.com/item?id=6725387 has some commentary on the <30 line JS spreadsheet. It includes some interesting discussion on functional "spreadsheet" implementation with Haskell.
Re:A spreadsheet in fewer than 35 lines of Tcl/Tk, no librar... by 616c on Friday March 27, 2015 @02:47PM (#9278286)
But if compilation is compression, what if I zip the aformentioned Basic and Kv2 versions? Do I win?

http://www.pvk.ca/Blog/2014/03/30/refactoring-with-lz77-comp...

(This is a joke, lest someone take me seriosuly.)