Hacker Newsnew | past | comments | ask | show | jobs | submit | travisa's commentslogin

The linked documentation in the first paragraph is confusing. It sets things in `context`, then calls `supertramp()`, which doesn't even use `context.user_index` or `my_custom_allocator()` specifically, which is not defined in the example? Are we to assume that `new()` somehow makes use of `context.allocator` and `context.user_index`? It goes on to explain that new(x) is also `new(x, context.allocator)`, but never explains the relevance of `context.user_index` No wonder people "misunderstand"


The code example is more to show the scoped copy-on-write behaviour of `context` more than how it is used in practice. I agree it might be a bit confusing and thus needs to be made clearer that is what the code example is meant to show. However, I don't there is any code example that could show "correct usage" of `context` without it defeating the point of it. As I say in the article, it makes more sense to leave it "confusing" because then people will ignore it.

The Overview is just that, an "Overview" and it's not meant be either a spec, a heavily detailed tutorial, nor an explanation of why a language construct is designed the way it is and/or why it exists. The latter of which would probably be as long as the Overview for each construct that exists if that.


The implicit idea is that new will always use a context allocator to create the thing. Not its own allocator that you cannot control. But yes that does not seem obvious to the guy trying to learn the language.


For those of us not up to date with the state of the art, can you provide references? Very interested!


Martin Thompson, of LMAX Disruptor fame, has I believe a novel solution in Aeron called the logbuffer, which fully formed 10+ years ago in that codebase.


Perhaps someone has a system that evolves bots by mutation, and these patterns are just the effects of 'bad' mutations. I'm not serious either, though.


As someone interested in compiler technology, I was happy to see a simple example of a tracing JIT in LLVM. See: http://lambda-the-ultimate.org/node/3851


Just because something is turing complete doesn't mean it is also effective at managing complexity to whatever degree. Any computation that can be expressed in Python can be equivalently expressed in Brainfuck, but one will be much shorter and easier to understand.

Instead, he seems to be asking for a revolutionary solution to the concurrency problem (mixing synchronous and asynchronous execution). That's all well and good, but he'll have to find the back of the line :)


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

Search: