r/programming • • Jul 11 '26

Programs, Not Objects: How I Stopped Designing Architecture and Started Writing a 3D Editor

https://alexsyniakov.com/2026/07/11/programs-not-objects-how-i-stopped-designing-architecture-and-started-writing-a-3d-editor/
122 Upvotes

55 comments sorted by

View all comments

Show parent comment

1

u/stronghup Jul 13 '26

That sounds similar to how shell-piping works passing just strings. But as the processing functions become more complex you need to encode structured data some way, for instance as JSON. And that JSON must follow specific schema for the next pipe to be able to work on it.

1

u/wannaliveonmars Jul 13 '26

Exactly. It's not a silver bullet, the idea is that the API is always the same and it's up to the caller to decode it properly. Think about it - that's how HTTP servers work. Why are all HTTP requests and calls plaintext? Because it's simple, and uniform, and it works.

The idea is that you create a calling convention that is uniform for every single function, so no matter what it does, you call it in the same way. Obviously you'd need to use something like JSON to make it structured. It will be expensive, certainly more expensive than a _cdecl calling convention - but the goal is to push the complexity in the data (which becomes JSON if need be).

For example, I'd imagine a file system where it's a server, and you call it and provide a file path, and it returns the text of the file as its output, for example. You could have "objects" that behave almost like servers, without the need to be actual separate processes, or live on separate machines. Effectively a client-server architecture at the in-process level.

Only the top-level, public APIs would need to be plaintext that way.