HNHacker News
TopNewBestAskShowJobs

jwmerrill

1,598 karma · joined April 5, 2012

Physicist, probability and geometry enthusiast, and software developer at https://www.desmos.com.

You can reach me at jwmerrill@gmail.com

submissionscomments
jwmerrill··on Wave-particle duality is the uncertainty principle in disguise
To put it another way, I think you are much more likely to absorb powerful ways of thinking while being entertained if you read https://what-if.xkcd.com/ than if you read http://phys.org

What If shows by example that you can apply quantitative reasoning to the most outlandish situations and actually draw interesting distinctions and conclusions.

Phys.org style reporting urges you to accept by argument from authority that the universe is mostly made of dark energy, and gravity is made out of particles traveling backwards in time through 11 dimensions or whatever it was I read last month I can't quite remember. These ideas come from actual serious research, but they aren't powerful when presented this way because you can't apply this style of reasoning successfully unless you have tons and tons of training working in the specific areas they report on.

jwmerrill··on Wave-particle duality is the uncertainty principle in disguise
I know that many people feel that you have to write like this to get anyone to pay attention (maybe they're right), but after enough years in physics, the breathlessness of this kind of reporting really starts to grate.

> international team of researchers has proved

> made the breakthrough

> discovered the 'Rosetta Stone'

I haven't read this particular article carefully, but I think it's safe to assume that words like "reformulated," "clarified," "extended," or "embedded in a new framework" would be more appropriate. Which is fine. New and better explanations are useful and important.

But despite what you may read, we don't find a new Rosetta Stone for quantum physics every year.

I get much more excited about science writing where the reader can come away with a better understanding of an actual concept, rather than just a sense that someone somewhere is doing something hard and smart.

jwmerrill··on The Itch Nobody Can Scratch
Yes, the author meant that searching for explanations is a basic human instinct.
jwmerrill··on Evolutionary couplings between files reveal poor software design choices
There's some really interesting thinking here, but interpreting this naively would suggest that the perfect software project has only 1 file.
jwmerrill··on What Students Do (And Don't Do) in Khan Academy
I didn't mean that teachers get a pass on opaque vocabulary when they're teaching students. I meant that, just like every other profession, they have a technical vocabulary that they use to discuss their own profession with other teachers.
jwmerrill··on What Students Do (And Don't Do) in Khan Academy
> The professional educator dialect of English is not very approachable for the layman.

I think Dan's blog is largely pitched at other professional educators. All professions develop their own technical vocabulary.

As an analogy, I recently enjoyed an article about the implementation of the v8 garbage collector by Jay Conrod: http://jayconrod.com/posts/55/a-tour-of-v8-garbage-collectio...

Here's a sample paragraph:

"Distinguishing pointers and data on the heap is the first problem any garbage collector needs to solve. The GC needs to follow pointers in order to discover live objects. Most garbage collection algorithms can migrate objects from one part of memory to another (to reduce fragmentation and increase locality), so we also need to be able to rewrite pointers without disturbing plain old data."

I think the article is an excellent piece of technical writing, but it would also be reasonable to say "the professional compiler engineer dialect of English is not very approachable to the layman."

That said, good communicators need to be able to change their presentation based on the audience, and it's too bad that the people at the meeting you mention couldn't find a common vocabulary.

If you want to see something by the author of this post that is pitched at the layman, he made a very nice TedX presentation a few years ago:

http://www.ted.com/talks/dan_meyer_math_curriculum_makeover?...

jwmerrill··on Elm 0.14 – Simpler Core, Better Tools
Author of that PR here. It may help Firefox some, but in my experiments I'm still seeing that driving canvas animations with Elm performs much better in Chrome than in Firefox.

If there are any Firefox engineers reading this, maybe there is a good benchmark to be extracted out of this observation? I'd be interested in discussing this with someone. Feel free to reach out at the e-mail address in my profile.

jwmerrill··on Lampsort: Leslie Lamport's Non-recursive Quicksort
> His trick is to ask the audience to give a non-recursive version of Quicksort, and of course everyone starts trying to remove the recursion, for example by making the stack explicit or looking for invertible functions in calls. But his point is that recursion is not at all fundamental in Quicksort.

I'm not completely sure what distinction Meyer is trying to draw between the implementation he discusses, and "making the stack explicit". He ends up with a "set" of intervals that he pushes onto and pops from, which might as well have been a stack of arguments.

Is the point that the order you pull things out of the set doesn't matter, so demanding that it behave as a stack is overly prescriptive?

jwmerrill··on I Love Julia
Both C and Julia are compiled to machine code before they are executed. C is compiled Ahead Of Time, and Julia compiles new code as it runs, Just In Time, whenever a function is called with argument types it hasn't seen before.

Parts of Julia's library and compiler are implemented in C, but this actually isn't very relevant to the speed of the generated machine code that actually runs.

Statements about Julia being "on par" with C mean that if you write code in a straightforward way to solve some problem, e.g. "find the three largest even integers in a collection," then Julia is capable of generating machine code that executes with efficiency "on par" with the machine code that C generates.

The "straightforward" part in the last paragraph is actually important. You could in principle solve this problem in any language by writing your own machine code generator in that language, and then the distinction between efficiency of different languages breaks down. But usually you won't do that, and so usually the distinction does have some meaning.

jwmerrill··on The Case for Slow Programming
> There have been very few scientific studies about the basics of building software...

There hasn't been a lot of great quantitative scientific study on how to productively do science either. Academic science is a craft, and is more or less learned through apprenticeships.

I'm trained as a physicist, and I'm certainly a fan of quantitative scientific methods, but I think it's important to realize that there are some areas where quantitative science is effective and rewards the required work well, and other areas where it is largely an ineffective waste of time.

I suspect trying to quantitatively study things like "how much unit tests really affects the bug density" is one of these cases with a poor reward to effort ratio.

There's a danger in trying to apply quantitative science to complex phenomena, when many or most relevant factors are actually uncontrolled and unmeasured. Once you have a number--any number--the tendency is to fetishize it at the expense of broader thinking. Make no mistake: quantitative measurements of the behavior of people performing complicated tasks do not carry the same epistemological force as quantitative measurements of the magnetic dipole moment of the electron.

Scientists themselves more typically try to understand their own craft through case studies and "professional wisdom" passed down from practicing experts to apprentices. Software developers would probably do well to (continue to) do the same.

jwmerrill··on Alan Kay on the Meaning of “Object-Oriented Programming” (2003)
Algebra in this context means a system of rules for deciding that two programs (or functions) that are expressed differently, are actually equivalent in the sense that they map equal inputs to equal outputs. I.e. f(x) and g(x) are equivalent if they return the same value for all x.

The algebra of arithmetic is the most familiar, and it lets us determine that f(x) = 1 + (1 + (1 + x)) is equivalent to g(x) = ((1 + 1) + 1) + x for any integer x. In this case, the relevant algebraic law is associativity.

One abstract way to think about integers is as sets of equivalent arithmetic trees, so "3" is a stand in for the set {(1 + 1) + 1, 1 + (1 + 1)}.

Other kinds of objects that can appear in a program can have similar kinds of equivalences under various operations.

As a less familiar example, take axis aligned bounding boxes. Translation and scaling both map an axis aligned bounding box to another axis aligned bounding box. Intersection maps two bounding boxes to one smaller bounding box. "Convex closure" maps two bounding boxes to a larger bounding box--specifically, the smallest bounding box that encloses both of them.

There are then various algebraic laws that let us determine that differently expressed combinations of these operations are in fact equivalent.

If "∧" represents intersection, and A, B, and C are bounding boxes, then f(A, B, C) = (A ∧ B) ∧ C and g(A, B, C) = A ∧ (B ∧ C) are equivalent because intersection is associative.

If we apply the same translation to two bounding boxes and then form the intersection of the results, this is equivalent to intersecting the boxes, and then translating the results.

There are also interesting equivalences that relate intersection and closure.

This kind of broadly construed "algebraic" manipulation can be used to rewrite one program into an equivalent program that executes more efficiently, and this is one way of thinking about what an optimizing compiler is doing when it optimizes a program.

jwmerrill··on Has Travel Become Another Exercise in Narcissism?
> The old man in me screams: It's not that travel has become narcissistic, it's that everything has.

Old men have always bemoaned the narcissism of young people. It isn't "kids these days," it's just "kids."

Maybe it's a cliche at this point to bring this up, but

“Our youth now love luxury. They have bad manners, contempt for authority; they show disrespect for their elders and love chatter in place of exercise; they no longer rise when elders enter the room; they contradict their parents, chatter before company; gobble up their food and tyrannize their teachers.”

is attributed to Socrates.

I've enjoyed the Language Log's "narcissism skepticism" over the years. Maybe someone else will too:

http://languagelog.ldc.upenn.edu/nll/index.php?s=narcissism

jwmerrill··on Firefox Developer Edition
Check the left hand side. There's a tab next to the file list that has a vertical stack trace.
jwmerrill··on Factor 0.97 now available
Factor has always been developed by a relatively small team, which makes their achievements even more remarkable. The language's creator, Slava Pestov, was a very important driving force in its development until around 2011, when he stepped down from leading the project to focus on a new job at Google.

John Benediktsson has been leading the project since then, and as the post mentions, there are and have been many other contributors, but I think it's fair to say that the project lost a lot of momentum when Slava stepped down.

Joe Groff, who was another important early contributor, and who is now part of the Swift team at Apple, gave a talk that included an interesting critical retrospective on the factor project (or at least one chapter of it). I'm sure there was a better formatted version of it at some point, but this is all I could find:

https://github.com/jckarter/zissou/blob/master/talk-notes.tx...

See "bad parts" for the criticisms.

Incidentally, these notes were the first place that I learned of the Julia language.

jwmerrill··on The Scientific 7-Minute Workout
I've really enjoyed Mark Rippetoe's writing about the difference between Exercise and Training.

From the gloss for Practical Programming for Strength Training [1]: "Exercise is physical activity for its own sake, a workout done for the effect it produces today, during the workout or right after you're through. Training is physical activity done with a longer-term goal in mind, the constituent workouts of which are specifically designed to produce that goal."

He emphasizes that a realistic means of progression is one of the most important aspects of any training program.

Practical Programming and Starting Strength [2] (which is a better introduction to these ideas for novices) are together the best analytical discussion of physical training that I've seen.

[1] http://www.amazon.com/Practical-Programming-Strength-Trainin...

[2] http://www.amazon.com/Starting-Strength-3rd-Mark-Rippetoe/dp...

jwmerrill··on When Those Who Know Won’t Share
I'd put it like this: variation among members of the same sex, race, country, age, etc. are very often larger and more important than aggregate differences between these groups. Ignoring this fact isn't just bad politics, it's sloppy thinking.
jwmerrill··on Building OS X Apps with JavaScript
A linked list is a tool for making sure that your data is never in the cache when you want it to be that a lot of developers fetishize because lisp and because they're so easy to implement that every CS curriculum will make you implement one at some point. Just use (dynamically growable) arrays, like, almost always, or heaps or binary trees in special circumstances.

Okay, now that I've got that out of my system, I'll try to contribute something positive. Linked lists are useful to understand because they're very similar to, but less complex than, a common representation of trees and graphs. In a tree or graph, each node can have several children instead of just one.

There are also some special algorithms that make use of the ability to grow or shrink a linked list in the middle without copying the whole tail [1]. The thing that makes this more rarely useful than you might think is that random access to the middle is O(n), so you have to be moving around in order adding/deleting things.

[1] Dancing Links: http://en.m.wikipedia.org/wiki/Dancing_Links

Note, this is actually a circular, doubly linked list.

jwmerrill··on Complex Step Differentiation
Not so. Roundoff errors happen because when you add a big number and a small number in finite precision, the result loses information that was in the small number. The magic of complex step differentiation is keeping the small part (the imaginary part) separate from the (potentially) large part (the value of the function evaluated at a real argument).

You can use a very small step size (and so get very high accuracy) with traditional finite difference differentiation at x=0 for functions with f(0) = 0. Complex step differentiation takes advantage of the fact that real valued functions of a real argument have 0 imaginary part everywhere on the real line.

> most problems won't be [well conditioned] and the complex step method won't help much then either

Try coming up with an example of this. You might be able to find one if there is a pole or branch cut very near the real line, but otherwise, complex step differentiation is very robust.

jwmerrill··on Complex Step Differentiation
One nice thing about this technique is that its time complexity is essentially the same as evaluating the original function. This property is shared by dual number differentiation mentioned by iadunning above.

Try symbolically differentiating deeply nested functions, and you will see that you end up with n^2 terms, where n is the depth of the nesting. E.g. Try differentiating n = 10 for (i=0; i<n; i++) x = sin(x)

Then notice that evaluating this function with a complex argument is only O(n), not O(n^2).

jwmerrill··on Complex Step Differentiation
Complex step differentiation is a hack for environments that have built in complex numbers, but that don't allow additional numeric types to be implemented easily. But it's a pretty clever hack.
jwmerrill··on Node.js Best Practices
It's to avoid using "new".
jwmerrill··on What every computer programmer should know about floating point, part 1
Just a heads up--the mediant algorithm can be O(d) in the size of the denominator for fractions that are close to 0 or close to 1 (it's possible for the denominator to increase by only 1 at each step).

The Aberth algorithm (I hadn't heard it called that; nice to know) is much more efficient--it converges quadratically.

jwmerrill··on FFT, Fast Finite Fourier Transform
Nice exposition of the simplest version of the Fast Fourier Transform. The theory has developed so far that it's easy to forget that there is such a simple version of it.
jwmerrill··on Ask HN: Who is hiring? (September 2014)
Desmos - San Francisco, CA

Desmos started by reinventing the graphing calculator https://www.desmos.com/calculator for the 21st century as one of the most advanced HTML5 apps on the web. In the process, we've developed what historians call a "business model," working with partners to push their content and assessment to new levels.

As our next act, we're raising the bar for what digital content https://teacher.desmos.com/ can look like, and creating classrooom experiences that are as delightful to use as they are instructionally effective.

But we've just scratched the surface of what we want to accomplish (ask us about our thoughts on project-based learning, or replacing multiple-choice tests, for example), and we need your help.

More about open positions at: https://www.desmos.com/careers

jwmerrill··on Why I'll Never Tell My Son He's Smart
Here's a paper by Dr. Dweck on the topic [1]. Thanks to dfabulich above for suggesting the right terms to google. I'm no expert at evaluating claims in developmental psychology, but this seems like credible research after a quick read through.

Note that the claims supported by the research here are closer to something like "praise of a certain kind makes children more likely to answer followup questions a certain way," rather than "there are two well separated groups of people that adhere to meaningfully differing mindsets in a persistent way."

Claims of the first kind are much less problematic, but as far as the latter, remember that there are many, many instances where the spread within a group of people is much larger than the difference between groups of people: that should be the default assumption whenever there isn't strong evidence to the contrary.

[1] http://web.stanford.edu/dept/psychology/cgi-bin/drupalm/syst...

jwmerrill··on Why I'll Never Tell My Son He's Smart
> Dr. Carol Dweck... has found that most people adhere to one of two mindsets: fixed or growth.

I'm sympathetic to Khan's overall POV here, but "research says there are basically two kinds of people..." always tickles my skepticism antennae.

Claims like this are so often overstated by researchers to punch up an abstract, and then so often simplified further in uncritical 3rd party reports that I wouldn't bet a sandwich on the truth of any such claim without seeing the data for myself. C.f. the widely believed and largely unsupported claims about learning styles.

Would be nice of Khan to link to the publications so we could decide for ourselves.

jwmerrill··on Metaballs and Marching Squares
Quick Desmos graph, if you want to play around with some of the math with less of the programming:

https://www.desmos.com/calculator/mvnrzlrhrz

jwmerrill··on Security Analysis of a Full-Body Scanner
It's also possible to have faint blue light, and bright red light.

Sound energy is quantized too, but for audible frequencies, hf is small compared to kT, so quantum effects are swamped by thermal effects.

jwmerrill··on A Unified Mathematical Language for Physics and Engineering (1996) [pdf]
There's a bit of discussion of how differential forms fit into the geometric calculus framework in [1], which is probably the most concise and readable introduction to the geometric calculus approach to differential geometry. All the machinery of forms is available as part of geometric calculus.

Geometric algebra/calculus has a more direct way to deal with metrical information using the dot product. Forms only use the wedge product: in problems where the dot product would be useful, forms simulate it by applying the hodge dual twice, which is a less intuitive and less direct way to get the job done.

[1] The Shape of Differential Geometry in Geometric Calculus, see section 19.4 for the bit about forms http://geocalc.clas.asu.edu/pdf/Shape%20in%20GC-2012.pdf

jwmerrill··on A Unified Mathematical Language for Physics and Engineering (1996) [pdf]
Dorst, Fontijne, & Mann is the best pedagogical introduction to geometric algebra that I have seen. I spent a couple years very excited about the ideas in Hestenes' papers, and Doran and Lasenby's book, but unable to actually calculate anything. Dorst, Fontijne, & Mann have very good exercises, and build up the general framework slowly and clearly.
← PreviousPage 6 of 8Next →