Haskell

For everything that's not in any way related to PureBasic. General chat etc...
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

pdwyer wrote:do you have control over the data structures though? Or are you relying on the product?

(not an attack, I'm honestly curious)
What do you mean exactly with data structure ?

The implementation of the basic datatypes is usually left to the compiler.
There is usually the concept of a "record" as well which allows the definition of
grouped data. I don't know how these are managed behind the scnene though.
quidquid Latine dictum sit altum videtur
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post by pdwyer »

Well,

Looking at the example of the qsort, it wasn't really following with one of the reasons its fast which is that it works in-memory on the array rather than allocate lots of new memory.

I'm wondering, lets say you want to implement LZW and you you have quite a bit of freedom of the structure that you use to store the 12bit sized lookup table, you can try some sort of hash table or list for example. Generally you have the control to arrange things as you think will be best for the situation that you are coding for.

I'm wondering if you are giving up any of that level of control with a functional language like this :?: It sounds like you specify more of the "what I want to do" and less of the "how I want to do it"

(but I'm not sure, thus the question :) )
Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
gogo
User
User
Posts: 11
Joined: Wed Jan 31, 2007 11:18 am
Location: France

Post by gogo »

Hello PB Lovers,

Here is my little contribution to this thread. I agree with many of your comments about functionnal programming. I also prefer to write code in PureBasic or other imperative languages. It's easier for me to think about an algorithm in PureBasic, C, java, ADA, .... But sometimes it is necessary to prove mathematicaly that your algorithm do what it is meant to do. And it is is almost impossible to prove it in languages with side effects like our favorite language.

Where do we need to prove algorithm ?
- Airplanes onboard programms
- Medical devices programms
- Nuclear plants
- .....
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

gogo wrote: - Nuclear plants
Tjernobyl had a beta version!
Post Reply