Hacker News new | past | comments | ask | show | jobs | submit login

The thing to remember though Is that these libraries are type safe, fast & general purpose.

I bemoan the lack of a similar library in go for instance because the lack of generics.

You can certainly do the same thing in C as well, but I can't easily mix it with code that has automatic memory management.

As for dynamic languages, can you actually do this? I'm not saying its impossible, I've just never seen it.




> these libraries are type safe,

not in this blog post:

    UnsafeAccess.unsafe
    UnsafeDirectByteBuffer.getAddress


Those are wrapped in type safe methods though (all type safety cross process has this step regardless of language/lib).

In nontrivial examples you tend to wrap more than Java longs but the techniques are the same.

EDIT: I realize now that I was bringing a lot of context with me that is not obvious just from the blog post. Martin Thompson and Todd Montgomery who are mentioned in this post (and Richard Warburton who isn't). Are the main authors of the real-logic libraries, which are extremely well known in JVM performance circles. Aeron in particular is a great IPC lib. Other libraries that are similar and in the same circle are Open-HFT Chronicle and the LMAX Disruptor. For that matter the author of this blog post @nitsanw is pretty well known in that arena.


Unsafe is usually used for allocating memory directly rather than having it be managed by the runtime. This has nothing to do with type safety.


In my sector it's compulsory to manage yourself the memory (videogames)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: