Hacker News new | ask | show | jobs
by Lio 43 days ago
Truffle is very good.

Could also use Matz's Spinel Ruby compiler. That's Ruby with static types using RBS but you have to give up some metaprogramming to get it.

I love the idea that we could get ractors written with Spinel and compiled ahead of time. I also love the idea that I can use Ruby for self contained binary tools.

(And for the sake of avoiding confusion, Crystal is also a great project. I'm really pleased to see them continue making progress).

https://github.com/matz/spinel

2 comments

Personally I don't like the thought of giving up meta programming, and I don't think it's necessary. Spinel is great as a pragmatic way of getting an AOT compiler for a Ruby subset though, but it's not that hard to support meta programming in an AOT compiler.

Though it makes it harder to generate fast code, it's not impossible given that most Ruby meta programming runs early and then doesn't change the program again, and most patterns are recognisable and it seems likely to be (I'm on and off working on my own Ruby AOT compiler) possible to statically verify for most programs that after a given point most code will not change types and so do static type inference to elide most type checks (a type in such a Ruby program will not be a given class, but a given version of a given class or meta class)

That's very funny to see, as I was just watching a presentation Matz gave last year where he was arguing static types won't be needed in the future because LLMs will just figure it all out, so Ruby with its dynamic types was well positioned to be the language of LLMs.

https://youtu.be/XVaRRryB_cQ?si=CuXiMDdwccH6wOra&t=760

Basically he's saying static typing is needed for AI today because it's "junior level", but for senior level programmers they are more experienced so these types blend into the background; therefore when AI is a senior level in the future, it will also not require static typing to not make mistakes. That writing correct code will be as natural to the LLM as moving your arm is to you.

Everyone wants their favourite language to be well positioned to be the language of LLMs, in reality they will eventually be good enough to generate code directly.

And in what concerns interpreted languages, they will be replaced by agentic runtimes as it is already the case in iPaaS cloud products.