Better HN
topnewbestaskshowjobs
Log inSign up

aka-rider

79 karma · joined Feb 29, 2020 (6y ago) · 55 submissions

Submissions

comment 2w ago · link · parent

> only annoying issue for me is that GLM-5.3 Flash is often eager to go into action

All models do that. Especially annoying when I’m in planning mode and asking a follow up causes complete replanning.

I added “user’s questions, often start with ‘Q:’ are not calls to action”

It works as long as I don’t forget the Q: marker

comment 1mo ago · link · parent

French and German languages have Latin origins.

In Ukrainian it’s «дощить» (from “дощ” — rain) — the form of the word tells you its function in the sentence. Same happens in other Slavic languages: Polish, Belarusian, Slovakian.

Latin languages rely on the order of words to explain their function. So much so, English speakers don’t say “blue big ball” in German, time before place is mandated.

comment 1mo ago · link · parent

Just ask Claude if it’s safe to touch.

Jokes aside, Opus 5.5 and Fable 5.1 are on another level. I was recently vibe coding an app, and after three days of prompting or so: sigh “I need to bite the bullet, and finally face the slop” — I started to read the code, and to my surprise, it was adequate. Not an amazing code, not a slop either.

I cleaned it up in one session. 50k LoC of Golang. Although even language is less important nowadays. People make DSL, and LLMs immediately start programming on this DSL.

comment 1mo ago · link · parent

Makes sense.

comment 1mo ago · link · parent

GC doesn’t affect performance (at least visibly), memory allocations on critical paths do. Moreover, Rust ARC may cause memory fragmentation and perform worse than a GC.

Writing Rust, Zig, or Go, you would still control memory manually, where it matters.

comment 2mo ago · link · parent

Yes and no. We used to have rampant script kiddies back in the '90s and early 2000s. After 2005-ish, well maybe 2010, most systems became adequate enough to not trust users' input, bug bounties, security as a separate role, etc, etc.

It would take at least some knowledge to hack, not just a random script from a forum.

Now, with LLMs, it's the '90s all over again.

comment 2mo ago · link · parent

Google is routinely buying and destroying competitors. They lower prices to kill competition en-masse. They promote their own products in search and elsewhere over paid ads.

Search Engine have chicken and egg problem, you can only have a good search if enough people use it to tune the ranking and see enough search spam cases.

“Just compete with a monopoly on their own field with one hand tied behind”

comment 2mo ago · link · parent

I don’t know about Windows but between MacOS and Linux mine experience is smooth. I can even cross compile from Linux to MacOS.

comment 2mo ago · link · parent

True, the main problem is how to split the work. They decided to go file by file.

To be fair, I haven't try exactly "rewrite in Rust" prompt, but I cannot imagine for this to work.

comment 2mo ago · link · parent

I don't know. The most Go software I encountered is IO-bounded, and usualy it's network latency. Rust cannot meaningfully improve this.

Although, in the agentic environment, a benefit of not having GC at all definitely helps.

comment 3mo ago · link · parent

> I have rewritten several things from eg. Python to Rust, Rust to Go very recently.

What is the scale? Because I'm pretty sure it's impossible to one shot 65k LoC with "good luck, make no mistakes" prompt.

I also did this within a subscription. I counted the number of tokens afterwards and calculated the cost as if I'm paying per token. $400 is of course arbitrary, but it's a ballpark number, bun was $165000.

> In my experience it mostly comes down to the harness (or lack of) that you use.

Yep, it is.

Tokens per task is a good proxy measure of skills, 'superpowers' or any other.

Either a skill gets you the thing more efficiently (less tokens), or you don't need to redo the result afterwards (less tokens). I benchmark all my skills that way.

Models need less and less steering at this point, especially frontier ones.

comment 3mo ago · link · parent

I'm glad to help

comment 3mo ago · link · parent

>files might diverge

The way rune works with files minimizes chances of silent corruption. I keep original byte blobs immutable, separately there is a journal (kinda WAL) of positional deltas (inserts and deletes).

So I only need to validate that blob + deltas = snapshot.

Disk IO is encapsulated through VFS, and writes are atomics (write to a temp file, then rename).

Separate virtual rendering buffer is built on top of that. Rune, like Obsidian, renders markdown preview inline, so the same chunk could be rendered as "Header" as well as `## Header` when under the cursor.

All of that makes it quite easy to work with text. The core function is to translate offset in a byte array to line and column and back, which is pure math and relatively easy to test.

Another trick that helped a lot is to use sqlite extensively: blobs, deltas, vfs, redo and undo history graph are all sqlite tables.

I noticed that LLMs make stupid decisions when it comes to data structures, but they understand CRUD and SQL, so I turned all Rune's internals into dumb CRUD.

comment 3mo ago · link · parent

This isn't complete example. I don't remember the details unfortunately.

But somehow compiler has decided that i <= limit is always true.

comment 3mo ago · link · parent

Thanks for the feedback. My main goal was to present the idea with an intermediate representation, I didn't payed much attention to the specifics of this translation, it would vary wildly depending on code bases.

65k LoC of Go without comments resulted in roughly 60k LoC of Rust witout comments (code column of the cloc tool).

The error handling is not so different between Rust and Go, in both cases I cannot panic to avoid the data loss. So it boils down to if (failure) return something for graceful degradation. And generally errors in my case (a text editor) are rare, only disk IO, which is encapsulated in one VFS module, everything else, like non-closed brackets in code is expected behavior.

The biggest differences were in third party libraries, UI, markdown parsing — completely different API and paradigms.

> Performance characteristics of resulting rust

I haven't measured. I don't think there's any significant difference between Go and Rust if app doesn't do allocations on a critical path. The reason I started this project was mainly to experiment (now I use similar approach to refactor much bigger legacy code base), and tree-sitter support is better Rust so it seemed like a good fit.

comment 3mo ago · link · parent

it depends, obligatory xkcd https://xkcd.com/1172/

comment 3mo ago · link · parent

Nice. Yeah, the general problem is how to divide and conquer. Your method is not always available (it depends on the language pair), in my case, Go packages didn't translate into Rust crates 1:1.

comment 3mo ago · link · parent

Not at all. The example was an experiment.

I did because I have a huge legacy code base, a distributed monolith, a few millions lines of code. Ideally, I want to get rid of it.

At this point, I know a recipe to break the monolith, so I finally could eat the elephant piece by piece.

comment 3mo ago · link · parent

Of course language concepts don't translate.

My point is that one can translate the data flow to another language.

You could imagine any program as input -> [blackbox] -> output. For example, same pixels rendered on the screen provided identical keyboard input.

I propose a way to decompose the blackbox.

comment 3mo ago · link · parent

> if you just let it rip on the problem for hours

In my experience, you can get good results if Fable does't write code itself, only spawn subagents.

I can run Fable for 10 hours, and it would output 50k tokens and read 300k (30% of the context window). The resulting code is okay-ish. I would rarely merge LLM-produced code first try without an adversary review.

comment 3mo ago · link · parent

Fable is good at instruction following, so just adding the snippet I mentioned in the post is good enough for the most cases.

There is a way to control tool invocations at the harness level when writing skills or agents.

Example: ~/.claude/agents/critic.md

    ---
    name: critic
    description: >
      Plan Critic. Reviews an implementation plan. Use before the implementation.
    tools: Read, Agent
    ---
For Claude skills, the frontmatter is different, the keys are:

    allowed-tools: Read Grep
    disallowed-tools: WebSearch Glob

https://code.claude.com/docs/en/tools-reference

comment 3mo ago · link · parent

>feed the same input to the old Go app and the new Rust then diff the outputs.

Yes, I completely forgot to mention, this is exactly my case. Rune is a TUI editor, so I feeded the same terminal sequences to the old and new apps.

It didn't translate 1:1 (I ported core editor first, there were side panels, and different chrome elements) so I instructed LLM to use ttyd (tty -> browser render), Fable then could open both apps with playwright, make and compare screenshots.

To rephrase, one critical component is to establish a feedback loop for the model. This new generation of models: Opus 5, Fable, GLM-5.2, even Qwen3.8-27B can self-correct, provided they know whether they are progressing or not.

A month ago, especially smaller model would fall into a rabbit hole it dug for itself and would never recover. This generation can sometimes run tens of hours without losing track.

I still wouldn't trust a model after 70% context window, but the progress is noticeable.

comment 3mo ago · link · parent

I don't remember the details, roughly it was unexpected invocation of move semantic, causing use after free in a loop.

My all-time favourite example is (again, my memory, I may be a bit wrong):

    for (int i = 0; i < (size_t)limit; ++i) {
    }
at some point limit could potentially become greater than INT_MAX, the compiler decided that i<limit could never be true because that would cause signed int overflow which is UB, so it "optimized" the loop into

   while(true)
signed unsigned mismatch makes me shiver

comment 3mo ago · link · parent

My understanding is, direct port is more expensive besides toy projects of course, looking at Bun and also listening to people who've done a few language conversions, they extract something first.

If not an intermediate representation, my first question would be: how to split the work. You cannot just prompt full rewrite of 60K LoC, you cannot do it module by module — modules do translate 1:1, like in my case golang packages did not matched Rust crates. Bun did file by file.

With hierarchical state machines in the middle, I did it almost in one shot.

comment 3mo ago · link · parent

It is all very unevenly distributed. SaaS and general web is basically on auto mode.

A lot of infra is vibe coded nowadays too.

Even prototypes are contributing to the speed of software development. Many people vibe code throwaway dashboards around the main platform which gives a lot of insights.

comment 3mo ago · link · parent

>You aren't Claude at least.

I absorbed so many different models at this point :)

Thank you for the kind words.

comment 3mo ago · link · parent

I would be afraid to do this with C++.

My friend once sent me a snippet, maybe 10 lines of C+++, asking "can you spot the UB?".

So I'm staring at these 10 lines, I KNOW there is an UB. I wasn't able to find it without a hint.

12