:^)
>>60844525
What is functional programming?
>>60844665
Programming something that just werks :^)
i fink
>>60844701
>something that just werks
you mean like objects?
>>60844723
i mean like windooz 10 or jewgle chrome
>>60844665
Input produces same output independent of program state.
>>60844795
Oh..
>>60844525
Good for specifying what you want the behaviour of a program to be, because pure mathematical functions are probably the most simple common abstract structure for expressing a relation.
Functional languages are often quite slow, though, so I think the ideal way of looking at this is to specify what the program should do in a functional language, and then use the functional language to prove a fragment of imperative code has the desired properties.
>>60844762
so windows and chrome are programming functions?
>>60844795
What? No. That's just a side effect of a program being functional.
Functional programming is when you avoid having any sort of 'state' in your program like mutable variables.
>>60844723
kek
But I like jumping around the codebase and looking for what the fuck is that global variable... just kidding. It's healthy approach, but purely functional languages are weird and do not perform so well to jump into it.
>>60845047
Nah, functional as something that "werks :^)"
>>60845123
>what are functions?
>just werks
>like objects?
>no like windows and chrome
>windows and chrome are functions?
>no, functions just werk
N-NANI?!
I think its cool. It's not a system I rely on, and I wouldn't write any large software in a purely functional language, but there are cases where I prefer a functional approach to accomplishing something.
>>60845147
Dunno how to explain it to you homie
>>60845197
>>60845264
S-Sorry... ;_;
I need halp.
I know quite a few fuctional languages and theory around them; I started programming with O'Caml, write an interpreter, a few UI shit and a vectorial editor in F#.
I want to take a leap and learn Haskell and put my semantics theory and theorem proving knowledge at use, but I can't find a suitable lang reference doc for my level, just introductory-level shitty tutorials.
Can you help me out?
>>60845147
post more of this, also source
>>60846649
https://en.wikibooks.org/wiki/Haskell
Skip the chapters you already know about.
>>60846691
>https://en.wikibooks.org/wiki/Haskell
based, thanks
>>60846691
>Haskell
Ugh. Miss me with that gay shit.
Talk to me when you learn scala
>>60844525
It's really good for symbolically deriving hierarchical equations. It gave me a few easy papers.
>>60844525
You have to leave the past behind and move into the future.
Did I enter /s4s/ and did not notice it?
>>60844525
I like programing without loops and if-else
>>60844525
>>60844701
>>60845123
>using the smiley with a carat nose
>>60848164
>Not using the smiley with a carat nose
>>60844525
Useful for some use cases, but otherwise a meme. And a slow one at that.
>>60846680
source is the internet
FP BTFO
>>60850346
>>60850478
>>60846735
Programming noob here, is this bait? Why has nobody mentioned scala? Are rust and haskell /g/ memes? Explain me
>>60844665, >>60844701, >>60844762, >>60845047
>Just werks ;^)
>I don't understand
Anon was making a shitty joke about functional meaning something functions.
Am I falling for bait?
Are these other Anons actual human beings?
I'm a mathfag
I prefer it over anything else, but it seems to be basically useless in the real world except for very niche applications.
>>60844525
I only ever used Erlang and started some emacs LISP basics, so my experience is quite limited, but I find that it works quite well when working on something that is most simply represented as a state machine. So I would definitely use a functional language when implementing something used in networking, like a server of some kind, but I'd never use it for working on a program that manages organized hierarchical sets of data, parses and writes them to/from JSONs and XMLs and such. And of course, then there's some other benefits that are language specific that Erlang has quite a few of.
what about F#, g
Functional programming in (((LISP))) may be good, but I have yet to see a good syntax for it other than presenting it in syntactical trees.
>>60851845
trashkell is good on paper but don't expect to code anything useful on it.
Programming without state is only feasible for certain applications. For real everyday stuff you want a procedural/OO language that also allows some functional tricks, or an environment that allows using multiple languages seamlessly (like C# and F#, Java and Scala)
>>60844525
elm & elixir are comfy
>>60852848
Feasibility isn't quite the right way of looking at it: you can make any stateful application into a pure one with enough BS but it can get very messy. It depends on how stateful the application is.
What's a good way of making something like a C struct in scheme?
Should I just use a hash table and get values with symbols, or are there better solutions?
>>60844525
I think pure FP isn't really production-ready yet.
Getting the types and functions of a standard library done well enough is an ongoing experiment of sorts.
Hybrid FP + OOP or Imperative is already the industry production standard for big data & big processing (and related machine learning etc). There is actually no other way that worked nearly as well.
>>60854965
I'd probably make a list of name-value pairs. Might be a bit inefficient storing a copy of the names for each copy of the struct, but I doubt people are that concerned about memory usage using scheme.
>>60844701
>>60844762
>>60845123
>>60846818
What the fuck is this shit?
up
>>60848164
˙͜>˙
I use it every day for work (OR PhD) and it is usually just the way programming should be done.
If it runs slow, it's probably because you programmed badly.
>>60852209
>quoting the smiley with a carat nose
>>60855825
>using the rotated smiley with a carat nose
>>60857868
>quoting someone quoting the smiley with a carat nose
>quoting someone using the rotated smiley with a carat nose
>>60846649
>O'Caml
It's called OCaml, you moron.
>>60844525
half life 3 is coming
Just started learning Scheme.
The functional mindset will make you a better programmer, so it's worth learning even though for all practical projects you're going to use oop
>>60859494
OOP and Functional paradigms are more similar than you might think. Becoming a better functional programmer will make you a better OOP programmer.
>>60859565
>tfw a majority of programmers today don't know how to write good code
>>60844525
Not fit for the current architecture of commonly used machines.
>>60859033
>>>/reddit/
>>60860182
>Not fit for the current architecture of commonly used machines.
git gud
>>60844525
What are the downsides really.
up