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

More philosophy about abstraction and the Divide and Conquer methodology..

2 views
Skip to first unread message

Amine Moulay Ramdane

unread,
May 30, 2021, 4:23:03 PM5/30/21
to
Hello,


More philosophy about abstraction and the Divide and Conquer methodology..

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

I think that humanity is abstracting much more with cloud computing and
with functional programming and such, but since i think i am a philosopher, there is a question in philosophy and it is the following:

Is abstraction always good ?

I think that abstraction comes with disadvantages and advantages,
so the best way is to know how to balance, it is like balancing between Evolutionary design with an agile discipline and Planned design since they both come with disadvantages and advantages, so abstraction can come with disadvantages like the disadvantage that i am speaking about
below, since functional programming has the tendency to much more
move the data between a memory region and another memory region, and it is inefficient, so i think that we have to take it into account and know
how to balance between abstraction and performance or speed, also abstraction comes with another important disadvantage , and it is
that it can become a monopolistic practice, i mean that when you abstract, the others can become too dependent on your abstraction and they can not understand the inside of the abstraction,
so they can become inefficient, so we have to be careful about abstraction since too much abstraction is not good, so i think that functional programming is too much abstraction and i think Chapel
is too much abstraction, read here more about Chapel:

WILL CHAPEL MARK NEXT GREAT AWAKENING FOR PARALLEL PROGRAMMERS?

https://www.nextplatform.com/2018/04/10/will-chapel-mark-next-great-awakening-for-parallel-programmers/

Read my previous thoughts so that to understand more:

More philosophy about one of the most important disadvantage of functional programming..

I have just posted previously my thoughts about continuation—passing style (CPS) and Monads, here they are:

https://groups.google.com/g/alt.comp.lang.borland-delphi/c/kdP6YSTcjj4

I think i am smart and i have just "quickly" noticed that when you are
using patterns of functional programming such as Map and Monads ,
it will come with a very important disadvantage, and it is that you will move much more the data from a memory region to another memory region,
so it is not efficient, since it is really slower, and i think that
it is one of the most important disadvantage of functional programming, since functional programming abstracts more, but it is really slower, so i have just given you previously an example of a "Maybe" Monad in Delphi, and here is an example of the "List" Monad in Delphi and notice how it is really slower by moving the data to the the returned result of the "Bind" function of the Monad as TmList object:


program List_monad;

{$APPTYPE CONSOLE}

uses
System.SysUtils;

type
TmList = record
Value: TArray<Integer>;
function ToString: string;
function Bind(f: TFunc<TArray<Integer>, TmList>): TmList;
end;

function Create(aValue: TArray<Integer>): TmList;
begin
Result.Value := copy(aValue, 0, length(aValue));
end;

{ TmList }

function TmList.Bind(f: TFunc<TArray<Integer>, TmList>): TmList;
begin
Result := f(self.Value);
end;

function TmList.ToString: string;
var
i: Integer;
begin
Result := '[ ';
for i := 0 to length(value) - 1 do
begin
if i > 0 then
Result := Result + ', ';
Result := Result + value[i].toString;
end;
Result := Result + ']';
end;

function Increment(aValue: TArray<Integer>): TmList;
var
i: integer;
begin
SetLength(Result.Value, length(aValue));
for i := 0 to High(aValue) do
Result.Value[i] := aValue[i] + 1;
end;

function Double(aValue: TArray<Integer>): TmList;
var
i: integer;
begin
SetLength(Result.Value, length(aValue));
for i := 0 to High(aValue) do
Result.Value[i] := aValue[i] * 2;
end;

var
ml1, ml2: TmList;

begin
ml1 := Create([3, 4, 5]);
ml2 := ml1.Bind(Increment).Bind(double);
Writeln(ml1.ToString, ' -> ', ml2.ToString);
readln;
end.


Output:
[ 3, 4, 5] -> [ 8, 10, 12]


Thank you,
Amine Moulay Ramdane.

0 new messages