HNHacker News
TopNewBestAskShowJobs

sharkbot

724 karma · joined August 23, 2010

submissionscomments
sharkbot··on Haskell School of Music by Paul Hudak
I pulled the Euterpea source from the website and tried the tutorial in GHCi 7.0.4. It complained that the definition of

  times (n+1) m 
is invalid.

If anyone is trying out the tutorial and gets the same error, replace that definition of "times" with

  times n m = m :+: (times (n-1) m) 
and you should be good.
sharkbot··on Why does changing 0.1f to 0 slow down performance by 10x?
Interesting discussion. Definitely something for the Lua programmers to keep in mind, as the default number implementation type is a C double. I did a quick test on my ancient MacBook, and the translation of the C++ code into Lua showed a slowdown for the denormalized case, although not as dramatic as the original problem (note: I changed the iteration count from 9,000,000 to 900,000 because the original count took way too long).
sharkbot··on Scientists Claim Brain Memory Code Cracked - 6 bit bytes
I was just about to comment upon the inclusion of Hameroff in the author list. Penrose and Hameroff are pushing a notion that the brain utilizes quantum coherence to perform computation inside these microtubules, resulting in human consciousness.

There is very little evidence for this conjecture, but Penrose and Hameroff are convinced. Make sure to keep Hameroff's bias in mind when reading this paper...

sharkbot··on The Internet Made Me Sad Today
It's the tragedy of the commons, writ large. "What's wrong with just showing one gaming ad to a precocious dinosaur-loving kid, she'll be able to concentrate on her studies later. Oh, maybe one more ad, maybe one more, maybe one more..."
sharkbot··on Faster-than-light neutrino result may have been due to bad connection
You're probably referring to is, "Extra, Extra - Read All About It: Nearly All Binary Searches and Mergesorts are Broken", discussed here: http://news.ycombinator.com/item?id=1130463

Talk about scary...

sharkbot··on D-Wave Defies World of Critics With ‘First Quantum Cloud’
In a nice instance of synchronicity, I was just reading a paper by Scott Aaronson, "NP-Complete Problems and Physical Reality" [1]. The paper talks a little bit about the quantum adiabatic method, which seems to be similar to simulated annealing, with similar limitations (on specially chosen SAT problems, the method can have difficulty overcoming local optima; see page 6 for discussion).

So, D-Wave may be selling an expensive simulated annealing hardware implementation, rather than a quantum computer.

1: http://www.scottaaronson.com/papers/npcomplete.pdf

sharkbot··on Visual proof that investors are bad at timing the market
What about the value of the equity? The equity's worth is not fixed; it's set by the market. So, if Person1's equity is now worth double, how does that change your scenario?
sharkbot··on Lexical vs Dynamic scope in clojure
The GHC Haskell compiler also supports dynamically scoped parameters via the XImplicitParams switch [1]. Type constraints are used to indicate which variables are propagated to the function.

I've used implicit params in my toy compiler code. While it somewhat simplified the structure of the code, I could have easily written the program without them.

[1] http://www.haskell.org/ghc/docs/latest/html/users_guide/othe...

sharkbot··on Debunking a 'hydrogen-powered' boat that claims to run on seawater
Wow! The wonders of such a storage technique! Hopefully the production of this liquid doesn't peak anytime soon... :)
sharkbot··on Debunking a 'hydrogen-powered' boat that claims to run on seawater
Um, do you have a reference for the seawater-powered torch? Google isn't coming up with much.

The reason why his mechanism cannot create thrust is in the linked article: the 2nd Law of Thermodynamics. Unless there is evidence that the boat suspends the laws of physics, this is the end of discussion.

sharkbot··on I Don't Understand What Anyone Is Saying Anymore
Ditto.
sharkbot··on Getting a little tired of 'security researcher' bluster
To be fair, there is no evidence that CIQ is "breaking the HTTPS handshake". The article I read implied that the software had access to keystrokes, which could be used to infer data that would be encrypted on the wire, not that it was breaking HTTPS.

It's possible that CIQ is getting keystroke information, but only storing metadata (character counts, number of corrections, etc). But, without more evidence, it's best to be wary. I think John raises a valid point; crack open a debugger, disassemble the .dex, start a network sniffer. Find out what is happening, don't just assume.

Edit: fixed minor typo.

sharkbot··on How scientists taught monkeys the concept of money
The name Marc Hauser piqued my interest. He has been accused of scientific misconduct [1], and his research has been tainted. Take this article with a suitable grain of salt...

[1] http://news.sciencemag.org/scienceinsider/2010/08/harvard-de..., via Wikipedia

sharkbot··on The Book That Every Programmer Should Read
Another book that takes this "soup to nuts" approach to the pillar of computer abstractions is Zalewski's "Silence on the Wire". It's mostly focused on computer security, but it does an excellent job of peeling back software abstractions and showing how innocent decisions like blinkenlights and link-following web spiders can be utilized to compromise security. My favorite computer security book, easily.
sharkbot··on Is free will really "free"? Your actions can be predicted from your brainscan
I don't see many arguments in Wilkinson's article. All I see are assertions, spiced with a unsubtle comment that neuroscientists are fabricating their results.

Neuroscience can shed light on the philosophical study of free will via empirical investigations, specifically the study of human brains. After all, if a philosopher wants to describe a property of reality, it must submit to empirical results. Philosophers can abstract away from reality if they wish, but they should come clean and rename themselves logicians.

sharkbot··on Ten Things Everyone Should Know About Time
As a person who is sympathetic to Buddhism, I appreciate what you're saying. But, what you are describing is still vulnerable to the "anesthetic defence": Can you (or someone) remain conscious after the administration of anesthetic, especially after training? If not, then consciousness appears to be a strictly physical phenomenon.

I haven't found any literature to suggest that consciousness thru anesthetic is the case. I don't deny that meditation may give you the impression that you have reached "deeper" levels of consciousness, but I don't think your conclusions are justified by the evidence.

sharkbot··on Ten Things Everyone Should Know About Time
You seem to be using obfuscatory wording to avoid the issue. We have evidence that physical brains are not just correlated with consciousness, they are the cause. Anesthetic is probably the best example; once you've administered anesthetic to a brain, consciousness is lost, while removing it restores consciousness. There is no continuity under anesthetic, the time is just 'skipped'.

A simple book that will help you get it, is "How the Mind Works" by Steven Pinker. Science assumes that consciousness depends on the brain, since that assumption explains the observations. What's more, we take assumptions for facts once we have enough consistent observations to overcome the biases of reasonable people.

sharkbot··on Ten Things Everyone Should Know About Time
Considering we don't have great definition of consciousness, it's a bit of a stretch for you to say that "Consciousness does not depend on anything..., everything else depends on it".

In fact, your broad statement isn't true. Consciousness does depend on having a physical brain in a certain state of development, and depends upon a "normal" chemical environment surrounding that physical brain (ie, no anesthetics). There are autonomic functions in the brain that absolutely don't depend on consciousness.

sharkbot··on Lets create a collaborative Book List on Computer Science & Programming
http://en.wikipedia.org/wiki/Design_Patterns_(book)

Commonly referred to as the Gang of Four (or GoF) book, due to the four authors: Gamma, Helm, Johnson and Vlissides.

sharkbot··on Why Haskell is Kinda Cool
The points you describe are valid, but there are a few nits:

Regarding your first point, your referenced article makes a misstep of its own, conflating the implementation with the semantics. From the article: "Do some folks believe we’re still doing what Church did, i.e., to encode all data as functions and build all types out of ->?"

From a semantics perspective: Yes. If it makes it easier to reason about, then treat variables as nullary functions. In the Spineless, Tagless G-Machine paper, both values and thunks are represented as closures, which may or may not be evaluated. For example:

  infiniteSeries :: [Integer]
  infiniteSeries = iterate (1+) 1
Is this a variable or a function? Having a special case for Double ("a closure containing a value") versus [Integer] ("a closure containing a thunk") is a distinction only important once the implementation becomes an issue (ie, lazy evaluation affecting memory usage).

As for your second point, typeclasses can include partial implementations. For example, the Eq typeclass [2] has a minimal definition required, either (==) or (/=), as one can be defined in terms of the other.

[1] research.microsoft.com/pubs/67083/spineless-tagless-gmachine.ps.gz

[2] http://haskell.org/ghc/docs/latest/html/libraries/base/Prelu...

sharkbot··on Global Interpreter Lock, or how to kill it
I'm not clear on the desired result of this project. Is it to make currently-unsafe Python code automatically correct? Or is it to keep the GIL semantics, but make it faster?

If it is the former, then I worry. Software transaction memory is hard to get right in languages without explicit and trustworthy annotations for side-effecting code (ie, types) [1].

1) http://www.bluebytesoftware.com/blog/2010/01/03/ABriefRetros... (currently down, but Google has a cached copy)

sharkbot··on Regarding Unit Tests
I find unit tests are useful due to a property they share with types, paired programming or formal specifications: you are forced to describe your program in two different "languages", and therefore have to think deeper about the problem. All of the aforementioned methods force one to code, as well as describe the intent behind the code. E.g., a unit test forces the programmer to describe the relationship of input/output, while the code describes the actual mechanism of linking input with output.

Code is always the most fundamental "description" of a program, but all the methods have some descriptive power. The process of having two separate descriptions should lead to a higher quality output, as divergences between the two show a possible misunderstanding of the problem, and hence a source of bugs.

sharkbot··on Steve Yegge v. Rich Hickey re: "Clojure just needs to start saying Yes"
Yegge points to the Tiobe language index as a metric to language adoption, and implies that "No" languages have low uptake. What about Lua? The Lua implementers don't accept public patches, rather they will rewrite public patches that are submitted, and only if the change makes sense (citation: http://lua-users.org/lists/lua-l/2008-06/msg00407.html). Yet Lua is #12, up from 20.

Saying "no" to language suggestions is not a bad thing, it all depends on the goals of the language and the philosophy of the language authors. Perhaps Yegge should try and understand the reasons why patches aren't accepted, rather than force their acceptance via his soapbox.

sharkbot··on Python Wish List
Bram's suggestion of a 'scrambled dictionary' is definitely an interesting method of testing for erroneous order dependencies, but I'm unconvinced it deserves to be promoted to a language feature. If he's worried about the code changes in his own project, perhaps Python's introspection tools could be used to replace all instances of Python lists with a custom implementation, assuming dictionary creation is an "up-front" operation.
sharkbot··on Moviebarcode - Movies compressed to a single frame
I was just thinking the same thing; see "Traffic": http://moviebarcode.tumblr.com/post/3432016573/traffic-2000
sharkbot··on Reasons to use Haskell as a Mathematician
I wouldn't consider its use ironic. A curried function is generally implemented using closures (i.e., a function that remembers the lexical environment of its definition). It might be a slight abuse of terminology, but not one that should give much pause.
sharkbot··on NASA scientist finds evidence of alien life
From Phil Plait's blog (http://mblogs.discovermagazine.com/badastronomy/2011/03/05/h...), the journal is closing, albeit after a conspiracy-soaked rant: http://daviddobbs.posterous.com/journal-of-cosmology-going-o...

Long story short: take this paper with a pretty large grain of salt.

sharkbot··on Learning 12 new programming languages in 12 months
I don't disagree with your premise, but there can be utility to trying out a number of different languages quickly and see which approaches resonate with you. A month with a language won't give in-depth knowledge of a languages' strengths and weaknesses, but it will allow one to move past the superficial differences (syntax, originally intended problem domains) and on to the philosophical ideas behind the language.

Trying Prolog, Erlang, Haskell and Scala in the space of 4 months while trying to solve simple problems (Project Euler comes to mind) should allow one to find a language approach that works. Object-oriented, lazy functional, concurrent or logical, one of those might stick. And if not, there's Lua, Ruby, Groovy, C#, Scheme, Perl6, Python3, Forth, C++, Brainfuck, ...

Each language has a core idea or two that could fit someone's personality. Then, the next year could be spent learning that language in-depth, as you mention. Finally, build upon that experience and re-evaluate the orignal list of languages; JavaScript looks better after Lua, Haskell is Scheme with Prolog-like pattern matching and a generic type system like an advanced C++, Forth and Brainfuck are about a simplicity even beyond Scheme's, etc.

sharkbot··on RethinkDB internals: making coroutines fast
Lua's primary multitasking primitive is coroutines, and they work quite well. Preemptive threading support can be bolted onto the language, but the coroutine support is well thought-out and elegant, and doesn't suffer from the limitations of Python's generators (i.e., yielding from within nested function calls).
sharkbot··on Killing Yacc: 1, 2 & 3
However, the article points out that we can only use the algorithm when we know it outperforms Yacc; read "know" as "proven theoretically".
← PreviousPage 4 of 5Next →