Hacker News new | past | comments | ask | show | jobs | submit | pedroo's comments login

> (tail call elimination is different than proper tail calls).

I'm not sure I follow. What is the distinction here?


Take a look here: https://en.wikipedia.org/wiki/Memory_management#DYNAMIC.

No one is really hanging on to previously freed space (except for the allocator, or if you're using a custom object pool allocation scheme) specifically for new versions of the array.

But if you're allocations look like this:

  array = malloc(<capacity>);
  // do stuff with array
  free(array);
  ...
  array = malloc(<new capacity>);
  // do stuff with array
  free(array);
with no other allocations in between then it is possible that the allocator might reuse previously freed array space.


I guess let me put my question another way: what's the advantage of being able to reuse previously freed array space for new iterations of the array, vs. having that space used for something else and using some other space for new iterations of the array?

It seems to me that, when reallocating, one ought to be able to say to the memory allocator "I want you to reallocate this array to a new size of [whatever]; go find a contiguous block of size [whatever], possibly overlapping the current array but not overlapping any other allocated memory, and copy/move the contents over there appropriately". (I believe that's what the "realloc" function does, no?). And, in that context, I can't see why any of the golden ratio stuff matters (though, of course, exponential resizing is still useful as noted).


Was just going to comment prior to your edit, but we really should compare rates of occurrance rather than population size.


> It's equivalent to the SQL JOIN...

Don't you mean GROUP BY?


I think parent meant equivalent in the sense of being "[a] very useful basic, common computation. (...) not something that you can really do without."


This sounds similar to the technique used in the integer-only version of bresenham's line drawing algorithm.


Sounds like an amazing journey. Congrats on all the hard work.


Thank you!

It totally was, and it continues to be. I built the beta in my free time when I came off missions on my last 12-month deployment to Afghanistan (returned April 2013). When I deployed in April 2012 I didn't know anything about tech. I listened to podcasts (I downloaded hundreds before deploying, mostly Mixergy) when I worked out (still do) and read a lot of business books.

I feel like I still have a lot to learn, but I've come a long way in the last two years. It's been one hell of a ride, I'm just happy I'm still enjoying it. Don't tell my customers, but I'd do this for free I love it so much haha.


It's spinning in the right direction. We're just inside the earth :).



Just delete the line. It should revert back to the default theme.


How much worse peformance-wise would generating PIC be to address this?


Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: