Better HN
topnewbestaskshowjobs
Log inSign up

siraben

2,833 karma · joined Nov 26, 2019 (7y ago) · 598 submissions

https://github.com/siraben

Vanderbilt CS and math. Yale CS.

Email me! siraben [at] siraben.dev

Submissions

comment 3d ago · link · parent

I've been working on a coding agent called Psi[0] (port of Pi) that is written entirely in ANSI C and Lua, MIT licensed. Tested on Linux, macOS, Windows, Haiku, BSD. The first three being the same executable too running via cosmopolitan libc. Otherwise it just requires a POSIX environment.

[0] https://psicode.ai/

2.

Show HN: psi, a 6.4 MB cross-platform portable coding agent in ANSI C & Lua(psicode.ai ↗)

4 points · by siraben · 2w ago · discuss

comment 2w ago · link · parent

The rewrite is configurably off for bash/tool calls below a certain line length. I would prefer not to read codegolfed bash and python for hours every day, personally.

comment 2w ago · link · parent

I prefer not the fight the RL as the models get better, unless I've measured it and haven't observed any degradation. There may be other costs/no. of turns considerations too.

comment 2w ago · link · parent

I've been daily driving Pi for over a month now and never looking back. The latest crop of frontier models have really complex bash calls, so I've written an extension that rewrites them into plain English while still making them easy to reveal in full, unlike some harnesses which seem to try to hide this from the user which is pretty irresponsible IMO.[0]

[0] https://github.com/siraben/pi-tool-summaries

comment 2mo ago · link · parent

Thanks, will look into this as another avenue!

comment 2mo ago · link · parent

Yes, this isn't meant to be a complete port and I only started dipping into mrustc because the previous agents were going off the rails. I have mostly been throwing spare weekly quotas at this but deeper thought will be required to get an actual working Rust compiler in C. Rust is an enormously more complex language, so it might just be at the capability limit.

comment 2mo ago · link · parent

Specifically the expensive part is getting a C89 port of mrustc to compile rustc 1.90.0. mrustc needs C++ right now, bootstrapping via TCC by writing it in C89 would be the shorter chain.

comment 2mo ago · link · parent

I am working on this![0] But this is actually a herculean task, I've been chipping at it for weeks and even trying to cheat somewhat by translating mrustc from C++ to C89. If anyone has ideas/cheaper ways to run it I would like to know.

In the meantime, months ago I achieved bootstrap of TCC (then GCC 4.6) via the same path as the live-bootstrap project but replacing the Scheme part with a C compiler in Ben Lynn's Haskell dialect.[1] This was a project I wish I had time to do years ago[2] but never had the time or motivation for, and the type of things agents can do well now (they couldn't write good Haskell a year ago).

[0] https://github.com/siraben/mrustc/tree/siraben/cmrustc

[1] https://github.com/siraben/blynn-bootstrap

[2] https://logs.guix.gnu.org/bootstrappable/2021-05-26.log#1438...

comment 4mo ago · link · parent

Thank you for the feedback! Will address. Yeah, I intentionally tried to not make the UI too easy to prove things and it shows all possible actions that can be taken from the current point, so that in the future another mode could be added for writing proofs from scratch.

comment 4mo ago · link · parent

I've been working on an interactive click-and-prove prover that is backed by dependently typed terms.[0] The Proof Machine only goes up to some Simply-Typed Lambda Calculus terms, whereas I have the logic sufficiently powerful to support recursion and reasoning about programs and equality.

[0] https://touchproof.siraben.dev/

comment 4mo ago · link · parent

The Z80 was how I learned assembly programming in high school.[0] Was a bit of an unusual choice, but high school students still carry these funky Z80 (or eZ80 now with the color screens) devices every day, so being able to hack on it and have plausible deniability while in class felt great :)

[0] https://github.com/siraben/zkeme80

comment 4mo ago · link · parent

I love traveling with this Anker 160W charger, which has 3 USB-C ports.[0] I just found out about GaN technology last year and I can't believe it isn't more widespread. This one can charge two MacBook Pros and an iPhone at full speed.

[0] https://www.anker.com/products/a2687-anker-prime-charger-160...

comment 4mo ago · link · parent

I use croc instead of magic wormhole as of a year ago now. In my testing the throughput is higher than magic wormhole because it uses multiple TCP connections to transfer the files.

comment 4mo ago · link · parent

This is very cool! I'd like to see a version for theorem proving/equational reasoning as well because I think the ideas behind reasoning about functional programs and proving properties about them are just many cases of rule-applying but people don't staring at equations or jump straight to a theorem prover, whereas a visual interface might make the transition a lot easier.

comment 5mo ago · link · parent

I got a bootable NixOS iso down to 91 MB. Pointed Claude at the Nixpkgs repo and asked it to strip things aggressively and inspect the build closure iteratively.

But the resulting ISO:

- has no network

- can't switch configurations

- doesn't have a text editor

https://gist.github.com/siraben/a8fce9912891d85e1ec3cf74081b...

comment 5mo ago · link · parent

Yes, to type a TI-BASIC program you have to go through the calculator menus which directly insert the tokenized input into the buffer.

The weird thing about TI-BASIC is how seemingly innocent changes in the input can cause huge performance regressions e.g. https://siraben.github.io/ti84p-re/sub-tibasic-for-paren.htm...

  For(I,1,N
  If 0
  1
  End
is much slower than

  For(I,1,N)
  If 0
  1
  End

comment 5mo ago · link · parent

It's highly likely that the original implementation language was assembly. The code is very idiomatic.

Regarding source build, I think reverse engineering it to the point where you can reconstruct the source is possibly legally problematic, so I don't plan to do this, but maybe for certain subsystems like MathPrint (equation display) which was especially fun to RE. I have a PR up for it and it will be live at

https://siraben.github.io/ti84p-re/mathprint

comment 5mo ago · link · parent

The plans are heavily subsidized by the AI companies so I didn't end up needing to do API usage or buy another subscription. I have ChatGPT Pro and Claude Code Max.

comment 5mo ago · link · parent

Thanks for the feedback, fixing.

comment 5mo ago · link · parent

This was made collaboratively by me directing coding agents at the binary, using Ghidra MCP extensively, disassembly and also dynamic analysis with an emulator. I don't have a writeup of the process but it was definitely not fully automatable (I wish though). I might prepare a blog post with transcripts and session history and things I learned along the way.

Broad takeaways:

- Ghidra MCP is not a silver bullet. Lots of opportunities for mis-decoding especially on older instruction sets (e.g. conflating code + data), which requires user input to flag data layout/structs.

- Agents still need a lot of user direction otherwise the RE production is just kind of a random walk. With Z80 it's decent at reading code but I expect that it has much worse performance than reading x86 or ARM for instance. The TI-84+ has a bunch of hardware quirks as well.

- GPT 5.5 is better than Opus 4.8 at RE. Opus 4.8 loves plausible-sounding RE'd logic without any checking. The gold standard is actually dynamically executing the binary and comparing the logic against the prose.

- Maintaining consistency in style and prose is a PITA across the wiki. Hard to reconcile prose <-> code. Can be somewhat mitigated by agent loops.

Was also in discussions with people in the TI calculator programming space who helped provide guidance as well. We previously did not have a catalogue of every subsystem in TI-OS yet alone most subroutines in the OS.

22.

Full Reverse Engineering of the TI-84 Plus Operating System(siraben.github.io ↗)

149 points · by siraben · 5mo ago · 24 comments

comment 7mo ago · link · parent

Without installing anything, this can also be reproduced with a shell script that uses a Nix shebang to specify the cross compilers.

https://gist.github.com/siraben/cb0eb96b820a50e11218f0152f2e...

24.

Show HN: Nonograms – Friends-only puzzle room with replays and leaderboards(nonograms.siraben.dev ↗)

5 points · by siraben · 9mo ago · 2 comments

comment 10mo ago · link · parent

browsh and carbonyl[0] are such lifesavers on airplane wifi. I find that carbonyl has even better chromium rendering than browsh.

[0] https://github.com/fathyb/carbonyl

comment 1y ago · link · parent

See also: https://en.wikipedia.org/wiki/List_of_Germanic_and_Latinate_...

comment 1y ago · link · parent

croc's throughput was also a lot better for me. I think this is due to them using multiplexed TCP streams.

comment 1y ago · link · parent

Archive link in case it gets taken down: https://archive.is/8MdtL

29.

Cygwin cross-compilation support added to Nixpkgs(github.com ↗)

2 points · by siraben · 1y ago · discuss

comment 1y ago · link · parent

My favorite aspect of kitty is the infinite scrollback. My scrollback is 10000 lines long and scrollback buffer itself can store 1 GB worth of history.[0] When you hit a certain shortcut, you can use any pager to search through the scrollback. It's all very fast.

[0] https://github.com/siraben/dotfiles/blob/84225d914acd226863e...

12345
20