HN user

UncleEntity

2,310 karma
Posts0
Comments2,788
View on HN
No posts found.

I just have them write the tools to write the DSL's to do the thing then (most of) the sloppy code stays in the generator and if all the different things depend on each other they don't go stale and whatnot. And let them design the DSL themselves for whatever task so it matches their 'internal concept' of how the things work.

Worked out pretty well so far but not really practical unless your goal is to make the tools to make the DSLs to make jitting VMs -- https://github.com/dan-eicher/BBQ kind of snowballed from "let's parse some binary files" to a way over the top toolkit for playing around with this stuff but, it's fun...

I mean, I got them to 100% using the official conformance suite on my copy-and-patch jit compiler/interpreter WASM VM...

Saw that Salt Language article a day to two ago on how they do the static verification as part of the compilation process (or whatever they really get up to) and that's next on the agenda, tried that with a JavaCard VM I was poking at as its 'computation space' is much smaller but that was too much for my poor little laptop to handle but, apparently, this Salt thing is much different and actually tractable so, we'll see, still working out the details.

What I suspect is this 17% is the exact sub-set it needed to hack together to make the goal (running some example website) a reality as this is what those dodgy weasels do if you let them. Then you get to spend 200x the time to fill in the rest of the "speculative features deferred due to no real consumer" on top of whatever dodgy system they made up, which is usually whatever is easiest/closest to the literature instead of the actual intended design. Lots and lots of fun to be had doing the full-pipeline refactors to add that last 2% which need support from tip to tail.

It's all in good fun, though... probably?

I was playing around with stuff trying to get Claude produce a JavaCard VM with the idea that the VM was hand written from the spec with a separate, independently produced, spec file used to generate tests for ESBMC to verify so an identical bug would have to exist in both to make it through. Worked out pretty well, found a few bugs in both projects, but my poor laptop can't handle the full 32-bit space so that part never got the full verification -- 16-bit, rock solid though.

Then I really got serious about the yak shaving and, well, am probably in need of an intervention as I don't get Claude to write a VM but to make the tools to generate a VM from an assortment of DSL and that has snowballed a bit as I really liked shaving yaks before the daffy robot revolution.

--edit--

Almost forgot, I tried that with the little less dodgy banned Claude and the wasm standard it wrote a python script to parse the spec pdf, the official bytecode implementation in OCaml (or whatever) and generate a TOML file (Claude loves the TOML) to generate the type headers and for cross-referencing in the other tools. Was so impressed I just let it go on its merry way and it did the deed.

I think the problem is they take the shortest path to the goal ...which may or may not coincide with what you have planned. Oh, and generally think instructions are merely suggestions and what you really want this this totally different thing and not the one in the plan you handed them plus, as a stoke of good luck, this other system is a lot easier to implement as well.

I mean, I spend more tokens having them clean up all the places they didn't follow the the plan (if I catch it) or implementing what came out of a 'complete and tested' previous plan where they just stop as soon as all the pathetic new test pass and you discover half of it isn't even there when trying to implement the next thing on top of it.

Though... I have been conducting an experiment, of sorts, where we've been cooking on these fairly complicated projects and I don't ever touch a single line of code, just yell at them a lot, and with suitable amounts of marijuana (they are very frustrating most of the time) it's been going pretty well. I also helps that they need to explain what they're doing to somebody fairly-baked -- maybe not such an HR friendly plan?

Control and effects are different things...

I've been quite smitten with Destination-Driven Code Generation and its separate data and control destinations feeding through to the sub-trees letting everyone know what's expected to happen to the data they're computing and where to go next. Makes a super-simple CPS converter as destinations == continuations and I can feed the CPS IR straight into a Click-inspired optimizer to do the things. It's actually fairly close to the design from TFA just based around continuations and whatnot instead of a SSA IR.

but the tail calls are integral to the function of the interpreter

Not really, a trampoline could emulate them effectively where the stack won't keep growing at the cost of a function call for every opcode dispatch. Tail calls just optimize out this dispatch loop (or tail call back to the trampoline, however you want to set it up).

Yeah, Clang's musttail and preserve_none make interpreter writing much simpler, just make yourself a guaranteed tail call opcode dispatch method (continuation passing style works a treat here), stitch those together using Copy-and-Patch and you have yourself a down and dirty jit compiler.

Now do it without those pre-written tests

That's probably the most important thing, actually. I've tried my hardest to get Claude to build an APL VM using only the spec and it's virtually impossible to get full compliance as it takes too many shortcuts and makes too many assumptions. That's part of the challenge though, to see how far the daffy robots have come.

...and the right-to-left evaluation logic.

The evaluation order doesn't matter as much as you don't really know what kind of function/operator you have at parse time so have to do a bunch of shenanigans to defer that decision until runtime while still keeping it efficient. Kind of fiddly to get right but once it works, it just works.

Claude and me (and a ton of decades old research) pretty much figured out all the complications in the APL parse/eval stack (https://github.com/dan-eicher/AiPL).

One of my experiments was to have Claude write a VM and then generate a verification harness (using a DSL) for it to ensure it was correct with the theory being the same bug would have to exist in the test suite, the static verification and the VM for it to sneak through. Found a few bugs in the verification library and some integer overflows in the VM then it became too much for my poor little laptop to run without cutting some important corners.

It's not an abstract thing they can't do, you just have to tell them to.

I find it as an interesting experiment to find the limits of what they can do.

Like, I've had it build a full APL interpreter, half an optimizer, started on a copy-and-patch JIT compiler and it completely fails at "read the spec and make sure the test suite ensures compliance". Plus some additional artifacts which are genuinely useful on their own as I now have an Automated Yak Shaver™ which is where most of my projects ended up dying as the yaks are a fun bunch to play with.

My project over the last week was to get the robots to train a neural net to learn the "303 thing", hasn't gone well at all.

The first one sounded like it was being played on a blown out speaker after it got run over and the second attempt sounded like it was going through a $20 pawn shop guitar pedal that got left in the rain which lead to the 'oh, you wanted the neural net to learn the 303's filter section? My bad, I just made some random stuff up as an approximation...'

The worse part is there's still compute credits left over from the initial ten bucks so we just have to try again...

The problem I run into is the propensity for it to cheat so you can't trust the code it produces.

For example, I have this project where the idea is to use code verification to ensure the code is correct, the stated goal of the project is to produce verified software and the daffy robot still can't seem to understand that the verification part is the critical piece so... it cheats on them so they pass. I had the newest Claude Code (4.6?) look over the tests on the day it was released and the issues it found were really, really bad.

Now, the newest plan is to produce a tool which generates the tests from a DSL so they can't be made to pass and/or match buggy code instead of the clearly defined specification. Oh, I guess I didn't mention there's an actual spec for what we're trying to do which is very clear, in fact it should be relatively trivial to ensure the tests match for some super-human coding machine.

[dead] 6 months ago

All I hear about is how this is the 'shape of things to come' with regards to the AI bubble while nobody seems to care that France just told all the gov't agencies to stop using their stuff.

Losing out on EU governmental contracts seems to me to be somewhat of a big deal and the France thing is just maybe the first move in that direction.

You know, for all my flaws I've always tried my hardest to be on the right side of history.

One can both believe that immigration policy is broken and also that the current way it's being enforced is immoral and unlawful. I took the same oath to the constitution when I joined the military as they did when they went into federal service and can see when when things are going off the rails.

My eulogy should be: "U.S. Paratrooper, Decorated Combat Veteran, Crazy Far Left Agitator"

> presumably not of personal vehicles

They don't magically gain more privacy protection in public over what your average person has just because they clock out after a hard day of work by virtue of being a government employee.

They are constantly and consistently reminded that people have the right to record in public and they chose to ignore that as there are no consequences if they violate the law. Or that people have a right to peacefully assemble. Or freedom of the press...

> If someone ends up sniping a famous person, we go back in time and figure out who they are

Yeah, most civilians don't understand operational security at the functional level.

Though... most people doing these thing probably want to be caught because they just aren't quite right in the head and want people to tell them that what they did is 'justified' for whatever reason.

Here's the problem, from what I've been hearing most of the actual criminals they've been "catching" are turned over by local and state law enforcement agencies with the rest are either in the process of criminal proceedings (that pesky "innocent until proven guilty" thing) or are involved in the immigration process as dictated by law.

They are literally pulling people out of judicial hearings, where the people are trying to comply with the law, and throwing them on airplanes without due process. Or just randomly snatching people off the streets with no probable cause including the occasional US citizen based on their (ancestors) national origin.

Seriously, my step-father's family became US citizens as a result of the Mexican-American War and the federal courts say it's probable cause to detain them based on their physical appearance. Like, WTF???

--edit--

Just remembered my grandmother saying she didn't teach her children Spanish because she didn't want them to grow up with and accent because she was literally beat if she spoke Spanish in school. True, this was 100 years ago but still...

IDK, it's probably more a matter where they don't want people to be flying RPGs into their windscreens and this is the first step for them to carry around frequency jammers. The last time I was in Iraq they used them to stop the cellphone detonated IEDs and all the convoys has one or two.

Coincidentally, folks won't be able to live stream their encounters but I'm sure that's totally unrelated...

> Also note, i.e. stuff like statutory rape has been upheld even in cases where the perpetrator in all good faith thought the victim was 18+, the victim initiated selling the services, and the victim provided fake ID showing they were 18+.

You had me up to the "selling the services" part.

If you are 'engaging' with someone in a criminal enterprise it's probably reasonable to assume they might misrepresent certain facts to make the sale.

Yeah... I had to quit reading after seeing the No True Scotsman argument about who can and can't form an opinion on the state of the robots. I don't have any professional experience but feel like I can see enough, through experimentation using the daffy robots, to see what's happening but my only formal software education was when I was in high school in the 80s so I don't count.

And why do all these conversations center around web apps and whatnot? I don't work on anything like that but probably know a lot more about virtual machines and compiler theory than your average web programmer.

Variation on Iota 6 months ago

Been working on the design of an optimizer for my APL VM and asked Claude how this would fit in (as we don't have Dyalog extensions):

  The pattern is:

  f⌿ X ∘.g Y                                                                                                            
                                                                                                                        
  Where f is an associative reduction and g is a comparison. iBurg could recognize this tree shape and apply rewrites based on operator properties:                                                                                         
  ┌─────────┬───────────────────────────────────┐                                                                       
  │ Pattern │           Optimization            │                                                                       
  ├─────────┼───────────────────────────────────┤                                                                       
  │ +⌿X∘.≤Y │ Binary search count (if X sorted) │                                                                       
  ├─────────┼───────────────────────────────────┤                                                                       
  │ +⌿X∘.=Y │ Histogram / count matches         │                                                                       
  ├─────────┼───────────────────────────────────┤                                                                       
  │ ∨⌿X∘.=Y │ Membership (hash lookup)          │                                                                       
  ├─────────┼───────────────────────────────────┤                                                                       
  │ ∧⌿X∘.<Y │ All-less-than (single comparison) │                                                                       
  └─────────┴───────────────────────────────────┘                                                                       
  The generic rules would be:                                                                                                                              
  1. Shape rule: f⌿X∘.gY avoids materializing n×m matrix if f and g have algebraic properties that allow streaming/early-exit                                                                                                  
  2. Sortedness rule: If X is sorted and g is monotonic (≤, <, ≥, >), use binary search                                 
  3. Associativity rule: If f is associative (+, ∨, ∧, ⌈, ⌊), can process in chunks or parallel
  
  The cost model decides when O(n log m) binary search beats O(n×m) outer product -typically when both n and m exceed some threshold.                                                                                                       
iBurg is the Bottom-Up Rewrite System (BURS) based optimizer to operate over the continuation graphs the parser spits out, not sure where the 'i' part came from though...

> Sam Altman has said “We’re profitable on inference. If we didn’t pay for training, we’d be a very profitable company.”

Any individual Sunday service is nearly cost free if we don't calculate in the 100+ years it took to build the church...