Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #6194

Read again, i correct some typos about pure functional programming languages and composability..

Newsgroups comp.programming.threads
Date 2020-12-26 16:33 -0800
Message-ID <ea15f4ed-fb7e-4262-b07b-aecb32476400n@googlegroups.com> (permalink)
Subject Read again, i correct some typos about pure functional programming languages and composability..
From Amine Moulay Ramdane <aminer68@gmail.com>

Show all headers | View raw


Hello..


Read again, i correct some typos 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 an important thing, 
since i think that pure functional programming languages have 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
   synchronization 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 synchronization 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.












 

Back to comp.programming.threads | Previous | Next | Find similar | Unroll thread


Thread

Read again, i correct some typos about pure functional programming languages and composability.. Amine Moulay Ramdane <aminer68@gmail.com> - 2020-12-26 16:33 -0800

csiph-web