Better HN
topnewbestaskshowjobs
Log inSign up

Mathnerd314

3,006 karma · joined Nov 1, 2009 (17y ago) · 1,339 submissions

Making the ultimate programming language https://mathnerd314.github.io/stroscot/

In the past I developed SuperTux (http://supertux.lethargik.org) when I was bored.

Submissions

comment 1y ago · link · parent

Well, with CPS it just works. You start with

  let
    x k = if x then k 1 else k 2
    E k h = if h == 1 then k 2 else k 3
  in
    \k -> x (E k)
and then when you inline E into x it becomes

  let
    E k h = if h == 1 then k 2 else k 3
  in
    \k -> if x then E k 1 else E k 2
which can again be locally simplified to

  \k -> if x then k 2 else k 3
Unlike ANF, no blind duplication is needed, it is obvious from inspection that E can be reduced. That's why ANF doesn't handle this transformation well - determining which expressions can be duplicated is not straightforward.

comment 1y ago · link · parent

If there was a clear distinction between let-bindings and join points, I would be happy. But there is not - there is this contification process and, rather than proving that their algorithm finds all join points, they just say "it covers most of the ground [in practice]", and then they cite (Section 4) two other papers that suggest contification is undecidable - whether a function returns to a specific continuation or function is a behavioral property, not syntactic. Even if you accept that the dominator-based analysis is optimal, it is a global property. not a local property like in a proper IR. So what I see is a muddy mess.

comment 1y ago · link · parent

What?

Let's say E[h] is "if h == 1 then 2 else 3", a is 1, and b is 2. Then before:

if (if x then 1 else 2) == 1 then 2 else 3

After:

if x then (if 1 == 1 then 2 else 3) else (if 2 == 1 then 2 else 3)

which trivially simplifies to if x then 2 else 3

Your proposed rewrite is "let a0 = if x then 1 else 2 in if a0 == 1 then 2 else 3" which is not a simplification at all - it makes the expression longer and actually introduces a variable indirection, making the expression harder to analyze. The call will require some sort of non-local analysis to pierce through the variable and do the duplication and elimination.

comment 1y ago · link · parent

If you think ANF is great then explain how to deal with the transformation from "E (if x then a else b)" to "if x then E a else E b".

comment 1y ago · link · parent

https://fahrplan.events.ccc.de/congress/2024/fahrplan/talk/H... looks fun. Also https://fahrplan.events.ccc.de/congress/2024/fahrplan/talk/P...

comment 1y ago · link · parent

> we find that poverty is still 3 percentage points higher in treated counties 10 years after the Walmart opening.

So... 10 years after Walmart opens, poverty is 3% higher, and annual household earnings decline by $4,230. Is this a huge effect? This is something like a 10 point difference on the SAT (https://www.cs.jhu.edu/~misha/DIReadingSeminar/Papers/DixonR...).

comment 1y ago · link · parent

I almost forgot about that ARM-Qualcomm dispute, the fireworks are only a few days away.

comment 1y ago · link · parent

Full opinion: https://www.courtlistener.com/opinion/10289420/an-opinion-wa...

comment 1y ago · link · parent

Well, look at the process of training a chatbot:

- first you make a "raw" corpus, with all the information needed to produce an answer

- then you generate sample question-answer pairs

- then you use AI to make better questions and better answers (look at e.g. WizardLM https://arxiv.org/pdf/2304.12244)

- can also finetune with RLHF or modify the Q-A pairs directly

- then you have a final model finetune once the Q-A pairs look good

- then you use RAG over the corpus and the Q-A pairs because the model doesn't remember all the facts

- then you have a bullshit detector to avoid hallucinations

So the corpus is very important, and the Q-A pairs are also important. I would say you've got to make the corpus by hand, or by very specific LLM prompts. And meanwhile you should be developing the Q-A pairs with LLMs as the project develops - this gives a good indication of what the LLM knows, what needs work, etc. When you have a good set of Q-A pairs you could probably publish it as a static website, save money on LLM generation costs if people don't need super-specific answers.

To add to the current top-scoring comment, though (https://news.ycombinator.com/item?id=42326324), one advantage of an LLM-based workflow is that the corpus is the single source of truth. It is true that good documentation repeats itself, but from a maintenance standpoint, changing all the occurrences of a fact, idea, etc. is hard work, whereas changing it once in the corpus and then regenerating all the QA pairs is straightforward.

comment 1y ago · link · parent

There is a longer essay called "On Truth", also by Frankfurt, less read but also more interesting IMO.

comment 1y ago · link · parent

One way to look at it is that most college textbooks are bad. They are written by one person, who has limited time, and limited understanding. And then you have a teacher who knows even less than the textbook, trying to explain the textbook.

In contrast, Wikipedia editors have all the time they care to spend on the subject (which is a lot!). They often reproduce the original discoverer's words, when appropriate. E.g., https://en.wikipedia.org/wiki/Central_dogma_of_molecular_bio... uses Crick's words. Whereas in the case of Maxwell, the formulation "is credited to Oliver Heaviside". Long story short: Wikipedia has the best explanations, and if you don't think so then fix it!

comment 2y ago · link · parent

I take away a different lesson: Dart is most likely slow out of the box. The author lists several reasons: int vs. Int64, GC interrupts, load hoist optimization. All of these are issues with Dart. Hence microbenchmarks, even without interpretation or validation, point to issues with the language implementation. They are not "meaningless".

It is true, one microbenchmark only shows that said microbenchmark is slow, not that the language as a whole is slow, but the plural of anecdotes is data. If you systematically evaluate a representative set of microbenchmarks (as in the Computer Language Shootout), then it is proof that the language is slow or fast.

Now of course one can argue about what is "representative", but taking random samples of code from across GitHub seems like a reasonable approach. And of course there is the issue of 1-1 translation but at this point LLM's can do that.

comment 2y ago · link · parent

The actual author is one person, user '5225225'

comment 2y ago · link · parent

There is the TARDIS monad in Haskell https://hackage.haskell.org/package/tardis-0.5.0/docs/Contro... It doesn't have the multiple timelines or killing features - it just deadlocks if there is a paradox or the timeline is inconsistent.

comment 2y ago · link · parent

Yeah, personally I'd use markdown too, at this point it is easier to use llama-3.1-8b to parse markdown / text into your JSON format of choice than it is to massage recipes into a specific markup like Cooklang.

comment 2y ago · link · parent

These authors have big Google Docs of evidence, https://jonathanhaidt.com/reviews/. But if you read it, you will see the effect is (AFAICT) limited to certain populations. There is a significant fraction of students that do have trouble with executive function and staying on task and will fail to do their homework because of social media access. Then there are the other students that have no trouble staying off social media when they have to do homework.

comment 2y ago · link · parent

> There’s a proper way to do this.

Is there? Seems like people will complain however fast you roll out AI, so you might as well roll it out quickly and get it over with.

comment 2y ago · link · parent

I looked into doing something like this and I was like "Todoist has AI, Notion has AI, how am I going to do any better than them?" So I didn't start. At this point I have specific prompts for ChatGPT and when I need this functionality I manually copy/paste them in and copy/paste the output into the todo apps.

Even after trying the site, I still don't think you have a marketable product, but kudos for shipping. I hope to see you back in a year with "How I made 1 million dollars shipping SaaS apps" blog post. ;-)

comment 2y ago · link · parent

Mozilla has a list, https://publicsuffix.org/list/, relatively easy to update. I'm sure there is some Python wrapper library they could use.

comment 2y ago · link · parent

I would say to look at credit utilization as a function of the other variables. Or more generally each variable as a function of the other variables. There is a bit of this in the initial correlation analysis, but a GLM is more robust.

comment 2y ago · link · parent

I think glm would be more interesting than clustering, would be good to compare the two. Or maybe UMAP.

comment 2y ago · link · parent

> Always Review AI-Suggested Code

So really the problem is a lack of code review... but I seem to recall that AI is decent at code review too. It won't spot state machine bugs, but SQL injections, no problem.

comment 2y ago · link · parent

This is one of the common accidents, the "right hook". https://velosurance.com/blog/how-to-avoid-most-common-riding... https://www.fcgov.com/traffic/pdf/bicycle-crashes.pdf

I mostly walk these days but when I did bike I had these crash patterns memorized so I could avoid them.

comment 2y ago · link · parent

> Free variables and closures

Are these even types? I always mentally filed closures under "implementation detail of nested functions".

comment 2y ago · link · parent

It doesn't account for quantum computing? Cracking passwords seems like one of those things that should get an exponential speedup with quantum computing.

comment 2y ago · link · parent

But Google didn't pay 2 billion to the couple - it went to the EU government. So now they have a civil lawsuit...

comment 2y ago · link · parent

> Living in a non-narrative way means rejecting a particular identity, and instead seeing life and meaning as a set of open choices.

I choose to fly up through the sky into outer space, away from this place. ;-) Oh wait, I don't have wings, and there's no way to fly into outer space besides maybe begging for a ticket on Virgin Galactic.

It's true that choices are important, but it's also true that you have less control over your choices than you might think (see e.g. The Power of Habit). In particular some choices that you would like to decide one way are simply impossible to actually do.

In practice I've found the best way to modify choices is to build tools. In particular my smartphone - at this point essentially all of my life is directed by apps. There are some cases where this backfires, e.g. recently I found myself driving to an event location and halfway there I realized the event had been cancelled and I had forgotten to remove it from my calendar, but it's the best I've got.

comment 2y ago · link · parent

For reference, SuperTux's code: https://github.com/SuperTux/supertux/blob/8d79ac7ce4db5e4225... (disclosure: not code I wrote, but I've tweaked it here and there)

The idea is similarly to just simulate one logical step at a time, with the fixed timestep (this is important because SuperTux uses simple Euler integration which is timestep-sensitive). But there is tracking code that sleeps / adds extra logical steps between frames so the rate of logical frames ends up corresponding closely to the rate of rendered frames. And as with the final solution here there's no interpolation in rendering, you just display the latest game state without storing the previous.

12345
45