Hacker News new | ask | show | jobs
by kristopolous 4353 days ago
The author needs to be less aggressive in the accusations. This current trend which supposedly "doesn't work" actually runs the vast majority of the modern web consistently and reliably.

Placing onerous restrictions on what someone is permitted to do in order to satisfy some formal abstract programming model - that is the thing that really doesn't work too well.

This makes arbitrary programming arbitrarily difficult: many simple concepts are completely prohibited. Fanciful convoluted ways that don't violate the formalism have to be fabricated...because we can't violate our arbitrary formalism! No! Not in the name of instructing a computer to do something. /me adjusts his english headmaster cap.

3 comments

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?

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.

There are advantages to both methodologies, but I must say I agree with you. The accepted academic practice is to find/develop the right formalism and then implement from there.

Despite this being akin to heresy, I much prefer to implement, then formalise later. I find it easier to "get the job done" that way.

Which functional language prevents you from passing buffers by reference?

Edit: I see there are quite a few. Please tell me about one :)

Alright ... I didn't mean this to be confusing ... here I'll remove that --- I was referring the whole class of languages which are more driven by purist theory than by practical need. There's quite a few that only support pass-by-value intentionally
C only supports pass-by-value (unless I missed something recent) and it's generally not considered a pure functional language.
C lets you make pointers to arbitrary things, so even if you somehow had a value containing your 1GB buffer, you could pass a pointer to it instead of copying it around.
sorry ... it's 340 am ... i'm screwing up my english. alright ... i'm going to stop replying.