HNHacker News
TopNewBestAskShowJobs

batterseapower

469 karma · joined April 12, 2009

Max Bolingbroke

http://www.github.com/batterseapower http://blog.omega-prime.co.uk/

submissionscomments
batterseapower··on Why the feds smashed Megaupload
The end of the article seems to say that Megaupload is US-based. As I understood it, many of the provisions in SOPA were designed for use against non-US sites. I suppose that if Megaupload had operated purely on foreign soil the US may not have been able to bring this case.
batterseapower··on Idris - pure functional programming language with dependent types
I haven't read the tutorial at all, but in dependently typed languages the type (Fin N) is exactly the type of "natural numbers under N", and I expect that is what Edwin is using in the tutorial.

As for compiling to that pointer access: from what I know of Idris, yes it will. Since you know statically that the array access cannot be out of bounds, you can omit the usual out-of-bounds checks.

batterseapower··on OCaml for the Masses
Several investment banks are using these languages in production (BarCap (F#) and Standard Chartered (Haskell) are the names that come immediately to mind).

And of course Minsky's employer, Jane Street Capital, writes everything in OCaml.

There are plenty of commercial users outside the financial sector too but those users tend to be smaller companies.

batterseapower··on On Blackout day, teach someone how to stop SOPA/PIPA
It is unfortunate that those of us who are not US citizens are going to be negatively affected by the blackout but are unable to take any effective action against SOPA/PIPA.
batterseapower··on UK Schools ICT to be replaced by computer science programme
Simon has been doing a ton of work behind the scenes getting a decent curriculum in place for computing in the UK, playing a major role in a group of educators tackling the issue. I would not be surprised if Michael's words were lifted directly from one of his reports :-)
batterseapower··on Don't return null; use a tail call
AKA double-barrelled continuation passing style
batterseapower··on Smuggling Data in Pointers
The Glasgow Haskell Compiler uses tagged pointers to implement lazy evaluation. Suspended computations are created as heap-allocated "thunks", and the runtime will tag any pointers to a thunk that is known to have already been evaluated, which can save one indirection when you need to "force" the thunk to get a value.

Furthermore, for thunks of algebraic data types with only a few alternatives (e.g. booleans, the Maybe type) the tag will encode which of the alternatives the pointer actually points to. So if you are case scrutinising a boolean you can decide which branch to jump to by inspecting the pointer only with no memory access.

This last trick doesn't work if the number of alternatives is > 3 (for 2 byte alignment) because there aren't enough bits available.

batterseapower··on Starcraft 2 Automated Player
I can beat Very Hard opponents with ease but am stuck in silver :-). Furthermore, he states that his AI is weak to early agression. This is not a problem for him because the builtin AI never cheeses, but it happens all the time on ladder and will severely impact his rank.

Nonetheless, I'm totally blown away by the project! Amazing work!

batterseapower··on Nest - The Learning Thermostat
Do they actually claim that? Their page claims that 50% of household energy usage is governed by the thermostat, but they are very careful to avoid any specific claims about how much Nest would reduce this usage.
batterseapower··on [dead]
A 5 page paper by a previously unpublished author with no associated institution? How does this have any credibility?
batterseapower··on Monads, Zippers and Views: Virtualizing the Monad Stack
This is pretty arcane even for Haskell aficionados. I have no idea what it is doing on Hacker News.
batterseapower··on Penny Saver
CoinStar in the UK/USA does coin counting+cash out for free as long as you turn coins into a gift certificate. Perhaps there is something similar where you live, it may be an alternative to the bank?
batterseapower··on Question for PG/HN: Where do you think we stand on your list of "ideas"?
I think you mean Resolver Systems. The web based spreadsheet is not their "core" product, though: they started with a desktop spreadsheet app.
batterseapower··on Those 500K Bitcoins that caused the flash crash weren't real
Due to how round-off is specified, cumulative errors in floating point calculations should average to 0 for typical workloads.
batterseapower··on Smalltalk's two-fold failure
This guy appears to be a well-known troll, which is supported by the incoherent nature of this article and the rest of his blog:

http://let.sysops.be/wiki/Richard_Kulisz

batterseapower··on 300% faster float point ops on ARM Linux
Basically what is going on here is that the system is recompiled to pass floating point numbers in the ARM VFP registers, rather than the integer registers.

This both reduces register pressure and means you don't have to marshal stuff to and from the integer registers at function boundaries.

The reason this hasn't happened before is because VFP is an optional part of the instruction set, and you can still configure compliant ARM cores without a FPU.

I'm not sure if their port uses NEON (the ARM SSE equivalent) at all.

batterseapower··on ABC (Australia) employee caught mining for Bitcoins on company servers
They aren't alternatives: spam is network IO bound, mining is CPU bound. The smart bot herder would do both.

The main danger is that the target notices that their machine is using 100% CPU and removes the bot. It is easier to notice CPU load (heat, fan noise, prominent position in Task Manager) than network load.

batterseapower··on The Bitcoin Crash
From WP: "John Law was a Scottish economist who believed that money was only a means of exchange that did not constitute wealth in itself and that national wealth depended on trade".

Also used as a pseudonym by Mencius Moldbug for his classic piece on gold: http://www.safehaven.com/article/5205/why-the-global-financi...

batterseapower··on I'm the guy who bought 259684 Bitcoins for under $3000 yesterday
There are 21 million bitcoins and they divide down to 8dp, so you need 16 decimal digits to represent them exactly. Coincidentally (?) double precision floating point is capable of precisely representing exactly 16 decimal digits.

http://en.wikipedia.org/wiki/Double_precision

So using double is in fact perfectly OK in this case.

batterseapower··on China's 'Wealth Drain': New Signs That Rich Chinese Are Set on Emigrating
My father-in-law is a Chinese millionaire (in GBP terms) and wouldn't dream of emigrating. The things that tie him to his homeland are all the usual elements: shared culture, shared language (very important, as he can't speak English), a huge range of cuisine.

China is a very nice place to live, especially if you are a millionaire, and I would be surprised if a larger proportion of rich Chinese emigrated than do e.g. the USA-born rich.

batterseapower··on Leaked NPD(German right wing party) donors-list meets Google maps
Why is it that people support secret ballot, but not secret donation? Both are forms of political support, and making them public can in theory prevent people from expressing their true views. So why is the secrecy of one protected, but not the other?
batterseapower··on Why Bitcoin Will Fail As A Currency
For another perspective: USD are "hoarded" by investing them in US treasuries. This preserves their value against inflation, because (to a first approximation) when the Fed prints money it does so by buying those treasuries, thus raising their price in USD.

So in the dollar economy, hoarding takes the form of purchasing USD so you can participate in seigniorage. In the bitcoin economy, hoarding takes the form of holding on to your balance. But they are both forms of hoarding, designed to protect value without actually making "useful" investments that affect the real world.

batterseapower··on Exceptions are monadic
You can implement "finally" as a higher order function in Haskell:

  finally :: Either err a -> IO () -> (a -> IO (Either err b)) -> IO (Either err b)
  finally (Left err) cleanup  _k = cleanup >> return (Left err)
  finally (Right x)  _cleanup k  = k x
You avoid having to unwind the stack because the user of finally has to manually convert into CPS in order to supply the higher order argument of type "a -> IO (Either err b)"
batterseapower··on Misuse of 3-D digital lens leaves 2-D movies in the dark
Possibly the UK? I've never heard of a cinema here without reserved seating - I didn't realise it was anything special...
batterseapower··on Why (UK) train departure information is not open data.
It's hardly unusual for entities that receive government money to also charge for products/services produced using that money. Three examples I can think of just off the top of my head include 1) the health service in places like France where there are subsidised usage fees, 2) farmers in the EU who get large subsidies from the CAP or the equivalent in the USA, 3) application fees in patent offices.

It is definitely super annoying that this data is not free, but the reality is that it does cost a bit of money to gather and aggregate.

Furthermore, though I frequently take the train, I do consider it unfair that general taxation revenues are used to fund the train services -- especially considering that if you look at the stats they are principally used by the wealthy. Charging for data goes some way to shifting the cost burden of rail back onto the rail travellers themselves, as the person ultimately paying for this data is the traveller that uses the train time app/website.

batterseapower··on How to compile with continuations
If you aren't interested in supporting call/cc or other control-transfer constructs like exceptions it might be easier to just use ANF.

See Kennedy's "Compiling with Continuations, Continued" for another perspective on the ANF/CPS choice: http://research.microsoft.com/en-us/um/people/akenn/sml/Comp...

batterseapower··on The Haskell Platform 2011.2 is out: GHC 7 for all
Possibly more up to date in Hutton's Programming in Haskell. I've heard very good things about it: http://www.cs.nott.ac.uk/~gmh/book.html
batterseapower··on GHC 7 is released. with LLVM, improved inliner, improved thread scheduler ...
Yes, the title is confusing. GHC 7.02 is significant because it will be included in the next Haskell Platform release -- GHC 7.01 was only available separately, and was not much installed.

GHC 7.01 was also a time of upheaval in the code base, with an almost total rewrite of the type checker. This was a bit buggy at first, but early experience with 7.01 means that it is much more polished in 7.02.

The full changelist from 7.0.1 is modest and available at http://www.haskell.org/ghc/docs/7.0.2/html/users_guide/relea...

batterseapower··on ILSpy is the open-source .NET assembly browser and decompiler.
I know one of the authors, David Srbecky: he was in my class at Cambridge. His final year undergrad project was a decompiler from IL to C#, so he had a big chunk of code for this lying around already - the Reflector changes provided the motivation to finally clean it up and publish it.
batterseapower··on How (not) to write Factorial in Java
Obligatory link to the (classic) Haskell equivalent:

http://www.willamette.edu/~fruehr/haskell/evolution.html

← PreviousPage 3 of 4Next →