|
|
|
|
|
by cmallen
5977 days ago
|
|
This isn't really part of the usual work environment. Just because you can import a library and go nuts with it doesn't mean it's an everyday part of the language. I mean really, kind of missing the point don't you think? It's not even like Haskell makes it trivial to mutate the pointers in a natively Von Neumann-esque manner. Monads don't count either. Example: how often have you seen unsafe C# code (pointers) used in a production web app? Counterpart to the above: How often do you see pointers used in C? All the time Presenting the pathological case isn't refuting what I'm saying, it's just affirming it by showing how far you have to go out of your way to abuse your memory access, whereas in C, it's just a part of how you code. (Functors, for example.) |
|
> It's not even like Haskell makes it trivial to mutate the pointers in a natively Von Neumann-esque manner.
Haskell has a module specifically for manipulating pointers[1]. There's no inherent safety in using Haskell rather than C for pointer based code.
> Monads don't count either.
This sentence makes no sense, and makes me think you've never (or seldom) used Haskell before.
> Example: how often have you seen unsafe C# code (pointers) used in a production web app?
Somewhat often -- pointers are used in database adapter, template engines, graphics rendering, and any code which needs to call into foreign libraries.
> Counterpart to the above: How often do you see pointers used in C? All the time
That's because C is used in code where performance is absolutely critical, which demands having control over memory layout and management. Pointers aren't a symptom of using C -- using C is a result of needing pointers.
[1] http://haskell.org/ghc/docs/latest/html/libraries/base-4.2.0...