![]() |
|
|
#1 |
|
Dec 2019
2×17 Posts |
Hi all,
I am a MS student (soon to be a graduated one) who just finished a programming course that centered around functional programming (FP). My interest is somewhat piqued and my professor informed me that some are using FP in distributed computing projects. I wondered if anyone had any thoughts on if FP could be faster than the current C implementation. I've read recursion is optimized more so than an imperative language such as C and the speed of parallel computation is also pretty great. No state, but there are "ways around that" my professor told me (perhaps moving things over a network?). It may be a side project I attempt as I am interested in learning more about FP and like the work that GIMPS does. Thanks! Daniel |
|
|
|
|
|
#2 | |
|
Sep 2002
Database er0rr
3,761 Posts |
Quote:
Last fiddled with by paulunderwood on 2019-12-11 at 01:25 |
|
|
|
|
|
|
#3 |
|
Aug 2006
3×1,993 Posts |
The idea is that a well-designed functional programming language could let you program in a functional style without a performance penalty compared to a close-to-the-metal language. It's not going to outperform them unless the other coder is doing something wrong.
|
|
|
|
|
|
#4 |
|
Romulan Interpreter
Jun 2011
Thailand
72×197 Posts |
During our Uni we really loved Lisp, and we really did nice things in it (like some playing-gomoku "brain") unfortunately it wasn't much of an opportunity to use it after. For a while we coquetted with it during the time it was supported by AutoDesk (their AutoLisp actually was nice and quite powerful, we use it to write a program that designed our LCD modules for us in AutoCad, given the dimensions and some other characteristics, then it was piece of cake to retouch here and there, much better and a million times faster than starting the design from scratch). Then our company switched to SolidWorks, which we still don't know how to handle properly... (well, much better price, aggressive marketing, etc). (In)fortunately, we don't do much of mechanical design now, being busy writing firmware (blind C and ARM assembler)...
|
|
|
|
|
|
#5 |
|
Dec 2019
2·17 Posts |
Cool, thanks for the quick replys all! I had heard about Prime95 being written in assembly, but was unsure about the rest (probably should have made that clear) and what, if any performance tuning could occur. Looks like whoever made this software are wizards already
.
|
|
|
|
|
|
#6 | |
|
Aug 2006
3·1,993 Posts |
Quote:
|
|
|
|
|
|
|
#7 |
|
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
22·5·72·11 Posts |
Challenge for you: write a useful program in C which is also purely functional in the FP sense.
It can be done, and I've faced and passed this challenge in the past, but it's not entirely easy to do. And I do not mean something as trivial as main(){printf("Hello world\n")}. |
|
|
|
|
|
#8 |
|
Romulan Interpreter
Jun 2011
Thailand
226658 Posts |
is the "factorial" good enough and functional enough?
or "hanoi towers" something? |
|
|
|
|
|
#9 | |
|
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
250348 Posts |
Quote:
If you do think you are any good, try implementing this rather simple function, given here in imperative pseudocode. Code:
INTEGER FUNCTION sum_func (INTEGER FUNCTION (INTEGER x) fun,
INTEGER from,
INTEGER step,
INTEGER to)
BEGIN
INTEGER temp;
INTEGER i;
temp := 0;
FOR i := from STEP step TO to DO temp := temp + fun (i) OD;
RETURN temp;
END
Last fiddled with by xilman on 2019-12-11 at 10:51 |
|
|
|
|
|
|
#10 | |
|
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest
10101001010102 Posts |
Quote:
|
|
|
|
|
|
|
#11 | |
|
6809 > 6502
"""""""""""""""""""
Aug 2003
101Γ103 Posts
100110010110102 Posts |
Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need some help on php programming | pinhodecarlos | Programming | 2 | 2012-07-23 18:17 |
| New to programming. What to do? | lorgix | Miscellaneous Math | 9 | 2010-12-08 22:22 |
| anyone know haskell or functional lang. at all? | jjoshua2 | Homework Help | 7 | 2010-01-27 08:21 |
| plz, help me in c programming | alaa | Homework Help | 12 | 2007-06-12 22:17 |
| programming challenge | Fusion_power | Puzzles | 25 | 2003-08-21 15:56 |