Hacker News new | ask | show | jobs
by tinco 4353 days ago
You need to better learn what you are talking about. Passing data by pointer is perfectly allowable in functional programming, how do you imagine passing something by pointer has side effects?

Data.ByteString is basically a pointer to a byte array, and it's one of the most common datastructures in Haskell.

Even more importantly, the optimizations the Haskell VM is allowed to do because of the immutability and purity constraints means that even naieve and trivial solutions using Data.ByteString on general I/O problems like webservers perform in the best of class amongst native competitors like Nginx.

edit: And the majority of the web is ran consistently and reliably? You mean apart from it being threatened by huge security vulnerabilities almost every month for the past 20 years? With so much insecure systems still connected that DDOS attacks are a day to day concern for system administrators?

1 comments

I didn't say Haskell. There are numerous programmings languages which only permit pass by value (and no referencing) for "I'm-such-a-smartypants" reasons.

I was really bashing the single-paradigm purist approach in general. It's much too rigid and difficult for anyone who isn't a card carrying mensa member.

Do you mean pass-by-value semantics, or copy-values-for-the-caller implementation? If you mean semantics, then yes: FP languages tend to like value semantics. However, I don't see what that has to do with referencing; you can certainly allow only passing things by value, but only pass references: that's what Python and C (and many others!) do, for example.

It sounds like you may be conflating pass-by-reference with passing references.

If you mean implementation: which ones? In the context of immutable and often even persistent data structures, copying them doesn't make a whole lot of sense.