https://github.com/evnix/funwithfunctionalprogram
Erlang/Functional solution to the problem
https://github.com/evnix/funwithfunctionalprogram
Last synced: about 1 year ago
JSON representation
Erlang/Functional solution to the problem
- Host: GitHub
- URL: https://github.com/evnix/funwithfunctionalprogram
- Owner: evnix
- Created: 2015-09-08T12:47:00.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-12T17:48:58.000Z (almost 11 years ago)
- Last Synced: 2025-03-01T02:42:35.170Z (over 1 year ago)
- Language: Erlang
- Homepage:
- Size: 1.79 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FunWithFunctionalProgram
**Note:** The program is written in Erlang which is a functional programming language, It would be coded & solved much faster in imperative languages like Java or C.
This program uses a client server concept. this means,
we could have 1000 of processes running on multiple servers working in union to solve the problem.
A **little** sacrifice in speed for scalability.
## To Run [Install Erlang-18]
````
erlc *.erl
erl -run mainp start
````
## Files
````
two_dim.erl [Erlang doesnt support 2 Dim arrays, so implemented it]
fhandle.erl [load contents of file into an array]
iterator.erl [function which actually recurses through data]
consumer.erl [server for consuming and discarding resultsets from clients]
mainp.erl [acts as the client and initiates all above modules]
````
Algorithm:
````
Currently, The algorithm works by recursively going through each element.
The program can be easily made to work on multiple computers.
the start2 function can be used to specify which part of the map to work on each computer.
There is also an implementation(commented out) to spawn one process per element.
````