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 The Verse Calculus: A Core Calculus for Functional Logic Programming [pdf]
Reinventing the programming paradigm has been Tim Sweeney's hobby horse since before 2006: https://groups.csail.mit.edu/cag/crg/papers/sweeney06games.p...

After Epic's wild success hes now got a bit of cash to splash on making his dream a reality :-)

batterseapower··on Can LLMs write better code if you keep asking them to “write better code”?
I tried it in OpenAI's O1. If I give it minimaxir's original prompt it writes the obvious loop, even if I include the postamble "Look for tricks that will make this function run as fast as possible in the common case".

However, if I then simply ask "What is the most probable result for this function to return?" it figures out the answer and a very good approximation of the probability (4.5e-5). From there it's easily able to rewrite the program to use the trick. So the creative step of spotting that this line of reasoning might be profitable seems missing for now, but 2025's models might solve this :-)

batterseapower··on Caltrain's electrification project is paying off
Annual ridership is about 7m passengers (https://www.caltrain.com/media/34265) or 9m if we annualize the numbers in this article. At the same time, the Caltrain is losing more than $33m/year (https://www.caltrain.com/blog/2023/04/financial-future-caltr...) even though it recieved a huge $410m subsidy from the state government for the capital investment required to complete the electrification. So it's losing more than $5 per ride even ignoring capital costs. In fact, the farebox recovery ratio is only 25%, which is truly horrible even by public transport standards: https://www.caltrain.com/media/33996/download

The curmudgeon in my questions where it really make sense for the Caltrain to exist at all, given that it:

  1. It is extremely far from covering its own costs
  2. The subsidy provided by the state is regressive because it principally benefits the wealthy commuters along the line
  3. It imposes substantial negative externialities on the South Bay both in terms of noise & traffic delays at grade crossings
  4. The line and stations occupy very valuable real estate that could be sold and put to better uses
batterseapower··on Mazeppa: A modern supercompiler for call-by-value functional languages
I don't think that's naive - it could definitely help ameliorate the issues. To my knowledge noone has tried this approach.

The other idea I had when I was working on this stuff was to do JIT supercompliation. Clasically, supercompilers expand the whole graph at compile time, but it would be straightforward to delay the supercompilation process until the first time that the code is actually executed, which helps tame the problem of generating lots of specializations that may never actually be executed in practice.

(Choosing a generalization heuristic becomes more important in the JIT setting because you always have access to the full info about all parameters to the function you are specializing, and naively you would end up e.g. specializing sigmoid(x)=1/(1+exp(x)) for each value of x observed at runtime.)

batterseapower··on Mazeppa: A modern supercompiler for call-by-value functional languages
Supercompilation doesn't depend on having a typed language - you can more or less derive a supercompiler mechanically from any operational semantics, typed or untyped.
batterseapower··on Mazeppa: A modern supercompiler for call-by-value functional languages
My PhD was on supercompilation for Haskell (thanks for the cite in the repo :-))

Cool to see that people are still working on it, but I think that the main barrier to practical use of these techniques still remains unsolved. The problem is that it's just so easy for the supercomplier to go into some crazy exponential blowup of function unfolding, making the compilation step take impractically long.

Even if you avoid a literal exponential blowup you can easily end up generating tons of specializations that bloat your code cache but don't reveal any useful optimization opportunities/are infrequently used in practice. Similar performance problems also plague related techniques like trace-based JITs, even though the trace JIT happens at runtime and thus has access to strictly more information about the frequency with which a trace might be used.

You can try to use annotations like the @extract proposed in the article to control these problems, but it can be hard to predict in advance when this is going to occur.

One interesting research direction might be to use deep reinforcement learning to try to guide the generalization/termination decisions, where the reward is based on A) whether the unfolding leads to a tie-back later on, and B) to what extent the unfolding allowed deforestation/beta reduction to take place.

batterseapower··on LoRA+: Efficient Low Rank Adaptation of Large Models
The other recent improvement suggested for LoRA is DoRA: https://magazine.sebastianraschka.com/p/lora-and-dora-from-s.... It really does seem to strongly outperform LoRA - see also https://www.answer.ai/posts/2024-04-26-fsdp-qdora-llama3.htm...
batterseapower··on Img2Prompt – Get prompts from stable diffusion generated images
Related - here's a fun short sci-fi story about a savant ("the prompt whisperer") who is able to intuit the prompt that was used to generate things: https://interconnected.org/home/2022/08/03/whisperer
batterseapower··on Full consensus for disconnecting Russia from SWIFT achieved, process has begun
Theoretically possibly by bartering for oil. The EU already has such a mechanism in place for buying oil from Iran: https://en.wikipedia.org/wiki/Instrument_in_Support_of_Trade...
batterseapower··on Work from Home and Productivity
This is an associative study and thus can't really tell us anything about the causal impact of working from home.

A recent properly-conducted randomized controlled trial found that WFH improves productivity: https://www.nber.org/papers/w18871

batterseapower··on Moderna mRNA sequence released to GitHub [pdf]
This very cool article explains the mRNA sequence chunk-by-chunk which might give you a flavour of why differences exist: https://berthub.eu/articles/posts/reverse-engineering-source...
batterseapower··on MasterCard to stop processing payments on Pornhub, cites unlawful content
Not just a hunch, actual US policy: "Operation Choke Point" was a 2013 inititative by the DoJ to hurt legal but unpopular businesses (e.g. payday lenders, tobacco, firearm dealers, and - yes - pornographers) by making it harder for banks to provide services to them.
batterseapower··on Wall Street Begins Trading Water Futures as a Commodity
These are financial futures. For some evidence that the presence of futures stabilises spot commodity prices see e.g. http://qed.econ.queensu.ca/CNEH/2005/papers/futures_CNEH_030...
batterseapower··on Show HN: Uncover how your funds spend money in politics
This is cool. I wonder how they mapped the PAC organization names + individual contribution employer names to ticker symbols? Maybe fuzzy matching, or just a lot of manual work...
batterseapower··on Forbidden Haskell Types
Thanks for remembering :P
batterseapower··on Forbidden Haskell Types
For another approach to making this work in Haskell, see this thread of mine from 2010: https://mail.haskell.org/pipermail/haskell-cafe/2010-October...

The relevant keyword if you want to learn more here is "equirecursive types".

batterseapower··on US unprepared for an electrical grid collapse, but it costs only $300M
I was curious about this question too so I tried to find a list of comparable risks. Wikipedia has a list: https://en.wikipedia.org/wiki/Template:Global_catastrophic_r...

The solar flare risk (at ~1% per year [1]) seems much more likely than many of the other items there. Supervolcanos, pandemics, war, and AI also seem like salient risks, but we probably shouldn't worry about e.g. gamma ray bursts or asteroids.

[1] https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/201...

batterseapower··on Fed to buy junk bonds, lend to states in fresh virus support
Market inflation expectations are below where they were at the start of the crisis: https://fred.stlouisfed.org/series/T10YIE
batterseapower··on Open-sourcing Riskquant, a library for quantifying risk
If you like the idea of this library you'll probably like the book "How to Measure Anything" by Douglas Hubbard (https://www.goodreads.com/book/show/20933591-how-to-measure-...). It's all about how to get sensible confidence intervals for things that are often considered unmeasurable such as the value of IT security. The book mostly uses Excel to do this modelling, but it looks like riskquant would be an excellent alternative on that approach, that for the more technically minded practitioner.
batterseapower··on The eleven nations of the United States and their cultures
There is some genetic basis for this: https://slatestarcodex.com/2017/02/08/albions-seed-genotyped...
batterseapower··on I've reproduced 130 research papers about “predicting the stock market”
https://www.aqr.com/Insights/Research/Journal-Article/A-Cent...
batterseapower··on U.S. Presidents and Comparative Stock Market Performance
Allegedly, stocks which are highly exposed to government spending outperform their low-gov-spending peers under a Dem presidency, and underperform during a GOP one: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1572801
batterseapower··on The gig economy is quietly undermining a century of worker protections
For ridesharing apps, at least, it seems clear that the gig economy has grown the total market and hence the number of workers needed to serve this market. Before Uber entered New York there were ~500k cab trips per day: now, yellow cabs only serve 250k trips but 700k trips are performed by ridesharers [1]. The negative effect on employment is about 3x smaller than the positive one.

[1] https://toddwschneider.com/dashboards/nyc-taxi-ridehailing-u...

batterseapower··on Building a language translator from scratch with deep learning
The value of large corpora for translation may be diminishing.. In particular, Facebook have achieved impressive results using unsupervised ML for translation: https://code.fb.com/ai-research/unsupervised-machine-transla...

The basic idea is to use word vector embeddings to build a source<->target dictionary, then combine this with a language recognition model to iteratively bootstrap a set of source<->target training examples for use with a conventional ML approach.

batterseapower··on The rich world needs higher real wage growth
Real compensation has become disconnected from wages mostly due to 2 factors [1]:

- Wage inequality (the average wage is growing faster than the median wage)

- Growth in benefits like pensions and health insurance which are not part of wages but are part of compensation

The inequality and benefits effects are about equally strong. Once you control for these 2 factors, compensation has risen at almost exactly the same rate as productivity growth, which is what you would expect of the economy in long run equilibrium.

[1] https://www.resolutionfoundation.org/app/uploads/2014/08/Dec...

batterseapower··on Hedge-fund managers that do the most research will post the best returns
Public info: https://www.sec.gov/dera/data/edgar-log-file-data-set.html
batterseapower··on Is vitamin D really a cure-all, and how should we get our fix?
Recommendations for vitamin D seem to be a bit of a trend recently, but the evidence for their efficacy does not necessarily seem to be there.

Meta-analysis suggests that supplementation in vitamin-D deficient populations does not reduce cancer, fractures, cardiovascular problems or all cause mortality (http://www.sciencedirect.com/science/article/pii/S2213858713..., https://academic.oup.com/jcem/article/96/7/1931/2833735).

One limitation of this research is that most studies are done with fairly low doses (700-800 IU is common). However, those few studies that look at higher doses (5000-1000IUs) you don't necessarily see any better signs. On the contrary, there is some evidence that high doses seem to be associated with e.g. higher risk of falls and fractures in elderly patient populations (https://jamanetwork.com/journals/jama/fullarticle/185854, https://jamanetwork.com/journals/jamainternalmedicine/fullar...).

batterseapower··on When CEOs’ Equity Is About to Vest, They Cut Investment to Boost the Stock Price
Interestingly, it's well known that the stock of firms with high levels of investment does worse than the stock of firms that do not invest as much -- see https://www.sciencedirect.com/science/article/pii/S0304405X1.... One possible reason for this is that managers may channel investment funds into unproductive empire building.
batterseapower··on Java Is Unsound: The Industry Perspective
You can also inhabit any reference type in Scala, even without "null": by writing an infinite loop :-)
batterseapower··on Open Sourcing the Microsoft JDBC Driver and Maven Support
As if the fact that jTDS is mostly unmaintained wasn't enough reason not to use it, the MS driver supports several extra useful features e.g. bulk insert and availability groups (for AlwaysOn)
Page 1 of 4Next →