Hacker News new | ask | show | jobs
by alkonaut 3156 days ago
I need that last drop of performance but only for a very small part of my code. For the rest, it's just painful to either have to implement iterators with tons of boilerplate ownership or declare things as sitting boxes on the heap. Both distract a lot from what I'm trying to do which is annoying.

I wish there was a higher level Rust sublanguage where heap allocation and GC was default, and you would use the "bare" Rust for the fast core of your program.

1 comments

You might look at LuaJIT as that language, with the inner loop in Rust.
It's very easy to do the Java/C, C#/C, C#/Rust, Python/C dance, but there is always a massive impedance mismatch at the boundary, and there are always two different build systems and package managers etc involved.

I'd like to see a language that is both systems and high level at the same time, with trivial interop and a common build system + package manager.

This could e.g be a set of low level extensions added to C# (Span<T>, ref returns etc is getting there) or a high level wrapper language/subset for e.g. Rust.

There is always a best tool for the job, and most jobs might require two tools, so it would be great if those two tools were aware of each other and came in the same toolbox.

Totally agree. The thing with LuaJIT or more appropriately stock Lua is that the VM is small enough to include in your project directly. If Vec and String were exposed to Lua first class construct, we would be a long way there.

The two most mature, well-designed languages in the Rust world are Gluon [1] and Dyon [2]

I believe there is a _great_ opportunity for something like Terra [3] but woven into Rust. Perhaps with the same type of compiler plugin that enabled HolyJIT [4]

The grail is having both a GC and an ownership based gc-free lower level all in the same language. Start dynamic, harden to static and sprinkle in properties.

As a side note, I have been thinking about how to bolt ownership onto a dynamic language and then I learned about Snowflake [5]. I think it would be totally doable to bolt ownership onto Java using annotations and AoT subsets of a program, completely escaping the garbage collector. This would be like Terra++

[1] https://github.com/gluon-lang/gluon

[2] https://github.com/PistonDevelopers/dyon

[3] http://terralang.org/

[4] https://github.com/nbp/holyjit

[5] https://www.microsoft.com/en-us/research/publication/project...

There is also a Lisp dialect: https://github.com/murarth/ketos