back
user profile

lerno

1,422karma·409submissions·April 1, 2014
recent activity (409 total)
comment
You lost me there I'm afraid.
1y ago·view thread
comment
Not possible to nest and possible to run down out of stack memory quickly. That said, C3 has a `@stack_mem(1024; Allocator mem) { ... }` which allows to allocate a part of the stack and use that as an…
1y ago·view thread
comment
> You can claim that C3 does not aim to solve memory safety for these reasons, _and they can be understandable_, This seems to be where we speak past each other. What the blog post talks is how C3 …
1y ago·view thread
comment
It doesn't zero on free, that's not what the code does. But if you're looking for something to prevent exploits, then no, this is not it, nor does it try to be. How would you want that …
1y ago·view thread
comment
Well, we've already tried that, and no one used it.
1y ago·view thread
comment
It is a problem for manual memory management. I am not quite sure where you're coming from. In Modern C++ this is managed by RAII, but if you instead look at C there is no solution that doesn…
1y ago·view thread
comment
> So the issue is clearly not solved. You can use --sanitize=address to get this today, or use the Vmem-based temp allocator (which is only in the 0.7.4 prerelease and only for 64 bit POSIX) if you…
1y ago·view thread
comment
> The article makes no mention of this, so in the context of the article the title remains very wrong The temp allocator implementation isn't guaranteed to detect it, and the article doesn…
1y ago·view thread
comment
> care more about binary size than speed That does not seem to be true if you look at how string formatting is implemented.
1y ago·view thread
comment
Memory safety as in the full toolset that Rust provides? C3 clearly doesn't, I fully agree.
1y ago·view thread
comment
Well, the title (which is poorly worded as has been pointed out) refers to C3 being able to implement good handling of lifetimes for temporary allocations by baking it into the stdlib. And so it doesn…
1y ago·view thread
comment
No, that is quite possible. You will not be able to use that memory you just returned though. What actually happens is an implementation issue, but it ranges from having the memory overwritten (but st…
1y ago·view thread
comment
This is about tracking allocated memory, which is different. I know V claimed it could solve this with static analysis, but in practice it didn't work and had to fallback to a GC. This is true fo…
1y ago·view thread
comment
Well the latter is covered: you can make temp allocations out of order when having nested "@pool"s. There are examples in the blog post. It doesn't solve the case when lifetimes are ind…
1y ago·view thread
comment
You can certainly do it with RAII. However, what if a language lacks RAII because it prioritizes explicit code execution? Or simply want to retain simple C semantics? Because that is the context. It i…
1y ago·view thread
comment
Well, there are no objects, no constructors and no destructors.
1y ago·view thread
comment
I would say that the title is easily misread. If you open the blog post and just read the title and a few lines into the intro, I think it's clear it's about C3 not having to implement any r…
1y ago·view thread
comment
NSAutoreleasePool keeps a list of autoreleased objects, that are given a "release" message when the pool goes out of scope. `@pool` flushes the temp allocator and all allocations made by the…
1y ago·view thread
comment
No, I don't think they do. Given a function `foo` that is allocating an object "o" and returns it to the upper scope, how would you do "escape analysis" to determine it should…
1y ago·view thread
comment
The benefit is that it: (a) works in a language without RAII, and C-like languages usually does not have that (b) there are no individual heap allocations and frees (c) allocations are grouped togethe…
1y ago·view thread
comment
I am not sure how this would be a problem. Certainly the resource manager should manage the memory itself in some manner. It has very little to do with trying to manage temporary memory lifetimes.
1y ago·view thread
comment
Imagine we have a function "foo" which returns an allocated object Bar, we want to pass this to a function "bar" and then have it released. Now we usually cannot do "bar(foo()…
1y ago·view thread
comment
A dangling pointer will generally still possible to dereference (this is an implementation detail, that might get improved – temp allocators aren't using virtual memory on supporting platforms ye…
1y ago·view thread
comment
C3 is a C-like programming language seeking to evolve from C. The 0.7.3 release doesn't have any major changes, but ends up with some gradual improvements such as: - type / typeid equivalenc…
1y ago·view thread
comment
Something you somewhat touch upon: early adopters are invested in the success of their chosen language because they are relying on its success to make their investment in early adoption pay off. If yo…
1y ago·view thread
comment
In this case, how would you prevent the user from seeing an invalid foo_vec before initialization? This is either "oh, it's in an illegal state", in which case it's just an annotat…
1y ago·view thread
comment
A C backend is planned.
1y ago·view thread