[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
20 years from now, will functional programming be the default
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 27
Thread images: 2
20 years from now, will functional programming be the default paradigm that most people reach for?

I don't mean 100% functional. But will most people think in terms of recursion, maps, and folds instead of for and while loops.
>>
>>54777884
people have been saying this since programming was created 200 years ago
>>
>>54777884
C has functions. Pascal has functions. Even some varients of BASIC have functions. Nothing new to see here. Move along. Do not pass go.
>>
>>54777884
Every decent language has closures already, or even monads. Pattern matching and list comprehensions are next.
>>
>>54777884
Nah, once moores law starts to slow down the only way to go faster will be to go closer to the metal. C and assembly reign supreme.
>>
>>54779330
C has to be replaced by something as low level but not as ugly and faster compiling.
>>
>>54777884
Look at C#, rust, etc.

functional will be the default within 5 years even
>>
>>54779274
Functions aren't first class in C or BASIC, idk about Pascal, but a functional language has first class functions as a requirement

>>54779494
C# is about as "functional" as Java and without mono it would be irrelevant to the programming community at large. Now rust, I'm stoked about rust.

>>54777884
The imperative languages will just keep borrowing things from Lisp and Haskell over time because they prove useful. First class functions, closures, immutability, typeclasses, tail-call optimization, macros, higher-kinded types... the list goes on. I don't think people will ever stop thinking about programs as a series of directives since that's how we think naturally and that's how the von Neumann architecture works. But to answer your question as worded, yes.

I think we have the Rails and Node community to thank for the recent uptick in functional programming, strange as that sounds. Here's to hoping that Rust and Scala get more traction.
>>
>>54780371
How are functions not first class in C? I can write a map that accepts a function pointer. qsort does this for the cmp function
>>
recursion is just a more cryptic and fancy looking way of doing the same things that loops do
>>
>>54780398
when you have pattern matching recursion tends to be much less cryptic than loops
>>
>>54780398
And the easiest way to destroy your stack.
>>
>>54779386
Agreed. i love C, but it could be better. go was a nice attempt, but fuck garbage collection
>>
>>54780371
>C# is about as "functional" as Java
C# has linq and will have pattern match, nullable shit, etc.
>>
>>54780371
>The imperative languages will just keep borrowing things from Lisp and Haskell over time because they prove useful. First class functions, closures, immutability, typeclasses, tail-call optimization, macros, higher-kinded types... the list goes on.
All of those except for macros (assuming you mean Lisp macros) and higher-kinded types were in imperative Algol-derived languages from the 1960s.
>>
>>54777884
Functional is dead. No point in using any of it. FYI bases programming is the future.
>>
>>54777884
I think Felleisen said it best: functional programming is just a codification of good design principles in software. Carmack's advice on programming functionally in imperative languages is nice too. Thinking of procedures in terms of sets of input, manipulations of that input, and output, leads to stable software that can be clearly reasoned with.
>>
>>54780389
splitting hairs here, but function pointers are not functions.

>>54780591
>go was a nice attempt
have you read or written a non-trivial go program? shit sucks ass. I'm hoping rust takes off

>>54780609
I don't see how linq makes it functional. Pattern matching is common amongst functional languages but it's not something required for describe programs as a series of functions. Java already has `Optional<T>` not sure what if this is what you mean by nullable.

>>54780669
yeah I meant Lisp macros, but also in a somewhat different vein, Scala macros. Lisp really was the progenitor for functional programming, but I'd like to hear more about what you said. what Algol derivatives are you talking about?
>>
Whichever lNguage will be for programming artificial intelligence will be the dominant one... so no
>>
>>54780773
>nullable
https://msdn.microsoft.com/en-us/library/1t3y8s4s.aspx
https://msdn.microsoft.com/en-us/library/dn986595.aspx
https://msdn.microsoft.com/en-us/library/ms173224.aspx
>>
>>54780773
i havent written a single piece of go. ive only read the papers
>>
>>54779386
scala native
>>
File: 1464178820940.jpg (97 KB, 640x640) Image search: [Google]
1464178820940.jpg
97 KB, 640x640
I hope because functional programming is a whole lot easier to grasp than the rest
>>
>>54781792
So basically just like everyone here who shills functional programming
>>
>>54780591
>fuck garbage collection
literally why ? it's like saying "fuck spaghettis" although it's the best food in the world
>>
>>54780773
>splitting hairs here, but function pointers are not functions.

Have you ever used a debugger in your life ?
>inb4 no because I only use Haskell therefore my code is always perfect
>>
>>54780389
Can you also easily compose functions? Can you do partial application? Can you create closures?
If you answered any of these questions with "no", your language does not support functions as a first class construct.
Not to say that it's inherently bad.

>>54780398
Sometimes recursion is cryptic, other times it is much more easily understandable than the alternative.

>>54780428
Tail recursion is a thing, you know. All kinds of other optimisations are also possible.
Thread replies: 27
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.