Caterpillar

Daily Thought - 2024-04-11

< back to list

Yesterday, I talked about how Caterpillar can be a simpler form of Rust. I also said that it can be a more powerful one, but then glossed over that completely. Here's one of the ways in which I'd like to make Caterpillar more powerful than Rust.

I think that most programming languages are really two languages in one. One to describe the runtime behavior, like defining variables and calling functions. Another for the compile-time behavior; defining functions, the type system. What if we used the same language for both parts? Then a macro would just be a function. The type system would just be a library. Can this work? I don't know. (Then again, I'm probably not the first to come up with this idea. I wouldn't be surprised if Lisp worked exactly like this.)

Maybe it would be a total mess. But what if it works? Would it mean that we can have an advanced type system that every competent Caterpillar developer can just innately understand, because they can always jump to the code that does whatever currently confuses them? Could we use Caterpillar's interactivity tooling to debug what's happening at compile time? I don't know, but it sounds like a promising possibility!

<< previous thoughtnext thought >>