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

Well, given that the post links to two different discussion forums, I attest that it’s not my responsibility to outline every single consideration of every single technique, nor is it my responsibility to include the entire syllabus of computer science to explain the background.

Instead, I outsource that to people like you. You voice your concerns here, and people can read them and make up their own minds.

Speaking of making up their own minds, please explain in more detail how the trampoline’s memory consumption grows unboundedly, to the point where it could cause an out-of-memory error. That would be most interesting for the community to ponder.




Why don't we just illustrate the problem using the code from the article?

https://jsfiddle.net/q59Ljeu7/

A loop is not just fewer LoC and easier, it is orders of magnitude faster than the ycombinator decoupled trampoline. The first alert is nearly instant. The second one takes almost a minute. My chrome dev tools are hard locked waiting for the ycombinator to finish.

This is not something I would encourage JS devs to use in practice.


Well, refactoring isEven or exponentiation to a loop is faster. But wait, you know what's even faster? Using built-in math primitives.

I wrote an entire article about refactoring tail-recursion to iteration and linked to it in TFA. I've also written a Scheme interpreter that can perform this optimization for certain functions on-the-fly. But arguing that the code is slow is missing the point by a country mile, and then some. The article is not arguing that the code is fast, or that you should always do this. I find it amazing that every time a programming technique is discussed, people want to worry about whether it belongs in production.

Is there no recreational programming any more? Or is it all about shipping the next app to deliver food by electric scooter? My world would be depressingly boring if the only things I thought about were the things I use at PagerDuty every day.

Now as to what I asked you about:

What you said was that this implementation leaks memory in such a way that using the trampoline it trades a stack overflow for an out-of-memory error.

I wish to understand that problem. Specifically, how does the decoupled trampoline leak memory?


[flagged]


That incivility ("You get a trophy, smart person.") is the inevitable end of this sort of pedantic flamewar.

Since you've frequently broken the site guidelines and we've already given you numerous warnings and requests to stop, I've banned this account. If you don't want to be banned, you're welcome to email hn@ycombinator.com and give us reason to believe that you'll follow the rules in the future.

https://news.ycombinator.com/newsguidelines.html


> There are plenty of people who will read it, then rush right out to duplicate it. That will bring bugs and chaos all over the javascript world.

Citation needed.

I seriously doubt that there's a horde of developers who--at this very moment--are pushing Y Combinator JS apps into production all thanks to this thought exercise.


Here's how it works.

I have the commit bit to the repo backing my blog. You do not. I f you have some serious suggestions, feel free to submit a pull request.

I'll review your PR and decide whether it matches the tone and style of my blog. If it doesn't , regardless of what you see as its merits, it will be rejected.

That state of affairs is not acceptable to most people, and fortunately, there is an alternative route forward: Instead of trying to lecture me about what to write in my own blog, and instead of lecturing me about what I should consider important to mention, and why, YOU CAN WRITE YOUR OWN BLOG POST REFUTING MY POST.

I am not being sarcastic. Great things have transpired in history when two or more people engage in a conversation via essays.

Words are so vague. I don't even know what "hard locked the dev tools" even means!

But if you write your own essay, with your own code illustrating your own ideas. Ah! That clarifies things for me and for everyone else reading.

It has never been easier to publish words. Avail yourself of this opportunity.

---

As for bugs and chaos all over the javascript world...

I have been publishing essays on the Internet for fourteen years. Most have been of a highly impractical nature: I save my practical thoughts for my work, and I scratch my "boy this is interesting" itch in my writing.

In all that time, I haven't broken the Internet. No hordes of people rushed out to implement macros in Ruby when I released Ruby.Rewrite.Ruby.

The JavaScript world was not taken over by decorators when I released Method Combinators. My book has an entire chapter on implementing traits in JavaScript. Where are all the traits?

(tumbleweeds)

I write to provoke thought. I think most people grasp that. You should have a little more faith in people.

Some people find these things interesting, even provocative. They may wonder if such a thing makes sense. But few people rush to implement an idea just because of one essay on Hacker News. Typically, they need to see a preponderance of momentum.

An essay from me. A library from someone else. A major framework baking it in. Only then will people bet their projects on it.

Until then, it's nothing more than one person, me, saying "Here's something interesting," and a bunch of other people saying, "indeed," over their coffee breaks.

Then we all go back to work and the world carries on just fine.

Honestly, with the exception of your statement that my trampolines will cause an out-of-memory error, you are not wrong about performance and the fact that practical applications for greenspunning your own trampolines are rare to the point of statistical non-existance.

I sense that everyone agrees with you, they just don't worry that hordes of Eternal September JavaScript n00bs will start swapping iteration for anonymous recursion powered by recursive combinators.




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

Search: