Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

About pure functional programming languages and composability..

0 views
Skip to first unread message

Amine Moulay Ramdane

unread,
Dec 26, 2020, 7:26:20 PM12/26/20
to
Hello..


About pure functional programming languages and composability..

I am a white arab and i think i am smart since i have invented many
scalable algorithms and algorithms..

I have just read about pure functional programming on internet,
and i think they are not talking about some important things,
since i think that pure functional programming languages has a major disadvantage, here it is:

Read about MVar of the pure functional programming language
that we call Haskell here:

https://www.oreilly.com/library/view/parallel-and-concurrent/9781449335939/ch07.html

So notice in the following code of Haskell from the above link:

main = do
m <- newEmptyMVar
forkIO $ do putMVar m 'X'; putMVar m 'Y'
r <- takeMVar m
print r
r <- takeMVar m
print r


I am understanding it , since it is also like a fork of Linux, so as you are noticing that with MVars of Haskell we can implement such
as event object and futures and such that also are energy efficient because of the blocking nature of MVars, but notice carefully that
we can have two kinds of deadlocks and here they are:

1- Communication deadlocks that result from incorrect use of
event objects or condition variables (i.e. wait-notify
synchronization).


2- Resource deadlocks, a common kind of deadlock in which a set of
threads blocks forever because each thread in the set is waiting to
acquire a lock held by another thread in the set.

So notice carefully that with the primitive of Haskell that we call
MVar we can implement event objects or futures that are prone to Communication deadlocks, so then we can say that Haskell is prone
to those kinds of deadlocks, so then it is not composable.





Thank you,
Amine Moulay Ramdane.













0 new messages