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

/fpt/ - Functional Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 71
Thread images: 6

File: lispatom100a9.png (75KB, 480x360px) Image search: [Google]
lispatom100a9.png
75KB, 480x360px
Functional Programming thread.
Last one: >>58301640

Resources:
>Erlang
http://learnyousomeerlang.com/content
>>Elixir
http://chimera.labs.oreilly.com/books/1234000001642/index.html
http://elixir-lang.org/learning.html
>F#
http://fsharp.org/learn
>Haskell
https://en.wikibooks.org/wiki/Haskell
https://0x0.st/pbp.pdf
>Lisps
>>Common Lisp
http://gigamonkeys.com/book
http://www.cs.cmu.edu/~dst/LispBook/book.pdf
Paul Graham's ANSI Common Lisp
On Lisp
Common Lisp Recipes
Land of Lisp
An Introduction to Functional Programming Through Lambda Calculus
>>Clojure
http://www.braveclojure.com/foreword/
The joy of Clojure
>>Scheme
SICP
Essentials of Programming Languages
How to Design Programs:
http://www.ccs.neu.edu/home/matthias/HtDP2e/
Art of the Propagator
Little Schemer
The Seasoned Schemer
The Scheme Programming Language by Kent Dybvig
Realm of Racket
Lisp in Small Pieces
>OCaml
https://realworldocaml.org/
http://ocaml.org/learn/tutorials/
>Scala
Functional Programming in Scala (Chiusano and Bjarnason)
Atomic Scala (Eckel and Marsh)
Programming Scala (Wampler and Payne)
Programming in Scala (Odersky, Spoon and Venners)
>Web languages
>>Elm
https://guide.elm-lang.org/
>>PureScript
http://www.purescript.org/learn/

Feel free to add more.
>>
OP Here,

I've been studying lisp and came upon this definition of how atoms in the atom table are stored

>In fact, the type-field and the value-field in each atom table entry are packed in a single 32-bit
word which can be easily accessed as a typed-pointer.

The typecodes being the most significant 4 bits of the 32-bit number, and the remaining 28 representing the index in the atom table. Which makes me wonder --

Is lisp is capped at holding 2^28 atoms? Does anyone here know more about this? Google seems to be turning up nothing.
>>
File: 1482737841187.png (786KB, 1000x1300px) Image search: [Google]
1482737841187.png
786KB, 1000x1300px
>>
>>58332163
I don't know, but if you consider the possibility of an atom table being an atom entry, then I think the limit is practically nonexistent. I mean there are techniques to represent arbitrarily large numbers, so I can't see why it can't hold for this situation.
>>
>>58334769
cute
>>
>>58336322
and pure
>>
>>58336476
>she's reading category theory
Is this what FP is based on? Should I look into it if I've only recently started learning Haskell and programming in general?
>>
>>58336756
No, but a few Haskell typeclasses are (Functor, Applicative, Monad, Arrow, Category)
>>
>>58336806
And what about type theory, is it related?
>>
>>58336852
strongly
>>
>holidays
>fpt reasonably active
>holidays over
>fpt can't sustain itself

proof that /fpt/ have jobs but /dpt/ don't?
>>
>>58340558
Half of the posts were people trolling the attempt a new programming thread, and the responses thereof by the few FP anons who saw it as an excuse to respond and bump the thread.
>>
>>58340665
That isn't true, look at the first few /fpt/s we had.
PLENTY of actual /fpt/ discussion.
>>
>>58340680
There's also the push vs pull factor.

/dpt/ vehemently hated web dev and wanted it out of /dpt/. They actively redirect webdev fags to /wdg/.

No one cares if someone talks about Haskell in /dpt/. /fpt/ is trying to pull people over from a general they're used to.
>>
bump

sad days for fpt

shall we just head back to dpt until the next holiday?
>>
Bumping: Clojure is excellent and everyone should try it.
>>
>>58336756
No, you don't need to know a lick of category theory to use the constructs like >>58336806 outlines. Category theory is just what inspired the design and naming of such features.
>>
>>58342909
What are the pros and cons compared to OCaml?
>>
>>58343593
Lisp
>>
>>58343593
I've never tried OCaml, but it's similar to Haskell, right?

Clojure has all the flexibility and cleanliness of a Lisp, and the robustness of the JVM. Clojure is well thought-out and has no baggage.

Is OCaml pure like Haskell?

Clojure does not force purity. Returning a random integer does not require 3 PhDs in combinatorics and category theory.
>>
>>58344298
>Returning a random integer does not require 3 PhDs in combinatorics and category theory.
>le epic exaggeration
>>
>>58344298
OCaml is not pure, and doesn't support ad hoc polymorphism (such as type classes)
>>
>>58340558
>holidays over
We have holidays since the 1st till the 8th of January.
I do give some life for /fpt/ and these threads finally got me to leaning Haskell, so at least one dumb nigga (me) can bump the thread sometimes.
The only problem with /fpt/ getting bumped between 4PM till 4AM EST, I barely have control on it.
I promise the thread after January 8 be bumped till the bumplimit. ATM I can't properly take care of thread. Sorry, guys.
>>
>>58344536
I think we should let /fpt/ die until we get numbers again
You can ask for haskell help in /dpt/
>>
Started CS a while ago, they started teaching us SML as a introduction to programming and I fucking hate it. The syntax and just about everything with this language just seems so unnecessarily diffucult and hard to remember.

Is that a thing all functional programming languages have in common or am I just dumb?

Mostly worked with PHP and JS doing some Web related stuff as a freelancer before, so maybe I'm just spoiled by OOP.
>>
>>58344658
it's different, that's the problem you're having
>>
>>58344658
It's just hard to remember because you aren't used to that syntax family. It's definitely more difficult to program than PHP or JavaScript but it comes with the benefit of a good type checker.
>>
>>58344658
elm is probably the simplest in the ML family:
http://elm-lang.org/examples/binary-tree
>>
>>58344585
>until we get numbers again
What does it mean?
>You can ask for haskell help in /dpt/
I didn't even except /fpt/ to get popularity.
First thread was much shitpostful, but when I saw how useful and pretty this thread can be, it would be painful for me to let it die.
>>
File: 21641667_p0.jpg (118KB, 663x841px) Image search: [Google]
21641667_p0.jpg
118KB, 663x841px
>>58340665
I know I'm certainly not posting three-post-long rants about Clojure and functional programming since I got off holidays.
>>
>>58332039
Add this book:
http://www.cs.cmu.edu/~rwh/pfpl.html
There's a free preview version in pdf format. You'll also need the notation guide (listed bottom of that page) it appears math heavy but it's not really once you figure out the notation, and have read something like Velleman's How to Prove It or these notes on set theory: http://math.cmu.edu/~cnewstea/teaching/21-128-F16/notes-current.pdf

It covers the theory of programming languages (design, implementation, correctness) and uses ML as examples, mainly concentrates on functional programming. It's also a course at CMU https://www.cs.cmu.edu/~rwh/courses/ppl/phil.html

If you read this book you can definitively answer the question "Conan, what is best in programming languages?". There's also this free SML book from CMU if anybody's interested (made up of notes from 15-150 Principles of Functional Programming languages) http://www.cs.cmu.edu/~rwh/isml/book.pdf
>>
>>58345943
I'll be adding those if I'll get to the creation of the next thread.
Anyway, it seems I must separate theory behind FP and languages.
>>
>>58345982
An Introduction to Functional Programming Through Lambda Calculus Book by Greg Michaelson is a good basic introduction too, much less academic but that CMU book (Principles of Programming Langs) is like the definitive academic guide to functional programming language theory so you can look at any func lang and understand what's going on. Difficult but not impossible book once you get used to the notation
>>
File: BHuItgVCIAAxAjQ.jpg.jpg (125KB, 768x1024px) Image search: [Google]
BHuItgVCIAAxAjQ.jpg.jpg
125KB, 768x1024px
>>
>>58347249
>>58346739
>The last two posts in ~1.5 hours are irrelevant shit
Give up. Let the thread die.
>>
File: 1483231794114.jpg (94KB, 499x542px) Image search: [Google]
1483231794114.jpg
94KB, 499x542px
>>58347265
It's 2am in the fucking morning you psychopath
>>
>>58347422
It's 8PM in the civilized world, nerd.
>>
21/41 posts are literally bumps or meta discussion about the thread being dead.
>>
Can somebody tell me how I'm expected to deploy a dynamic Haskell library designed to be used by languages that aren't Haskell?
When building an executable, GHC seems to statically link everything it needs and I can drop it on any machine without any problems. However, once I try doing a library I'll get errors from missing dependencies like libHSrts, libHSbase, as well as the cabal packages I installed.
Am I really expected to copy some 40 .so files over along with my library?
>>
>>58347493
But it's 12 here
>>
>>58347422
you're entitled to your opinion lol
>>
Give me your personal functional language ranking.
>>
>>58340558
>fpt
>jobs
>>
>>58350281
VB.net (#1)
Java (#2)
Rust (#3)
...
Haskell
>>
>tfw no HELM completion for the SLIME repl
>>
What kind of job can you get with FP?
>>
>>58351466
Depends on if you consider neetbux to be a job
>>
>>58351530
Yes!
>>
>>58351466
A job at any company that uses a functional language.
>>
>>58351466
Somewhere in telcos, I think.
>>
I've taken a basic functional programming course at university (sml/nj), so I know the fundamentals, but as a professional software engineer I don't think I've ever encountered a production system written in a functional language

Do you guys do functional programming as a hobby out of interest (nothing wrong with that), or are you actually working on professional production systems?
>>
>>58355700
What are you trying to determine with an anecdotal answer to your question?

If someone responds, "Yeah, I write these components for the one subsystem at this one company", is that going to make you think that FP is any more popular?

Yeah, there are jobs that utilize FP, but they are currently a tiny, tiny minority. However, if you take common multi-paradigm languages that can be used in very functional ways, then "functional programming" is extremely popular, just not in FP-based languages.
>>
>>58355810
>If someone responds, "Yeah, I write these components for the one subsystem at this one company", is that going to make you think that FP is any more popular?

I don't care about popularity, I'm just wondering if there are modules or systems in the systems I am leading that could be improved by using a different paradigm

Hence I was hoping for anecdotal answers from people doing exactly that and their experiences on using FP in a larger production system
>>
Let's face it. Strict type system, no side effects, Lazy evaluation, easier concurrency are just buzzwords.

What's truly nice about Haskell is the aesthetic of the syntax and the where clause. Fuck me, the where clause is just amazing.
>>
>>58357420
Why not just type "bump" like the rest of your posts?
>>
>>58357449
Because I don't really care about bumping, I just like the where clause.
>>
>>58357420
Actually, lazy evaluation is fucking horrendous, and you should feel fucking horrendous.

But yeah, I like a good 'where' clause. 'let' peasants can get out.
>>
>>58355700
Biggest petrol company in my country has most of it's codebase in lisp. It's not purely functional, but parts of it are. (there is also a lot of cobol -.-)

I don't work here, so I don't know much about it, but some of my friends do.
>>
>>58357698
What country?
>>
>>58358751
Slovenia (former Yugoslavia), company is called Petrol.
>>
>>58358778
COBOL in former Yugoslavia?
I am amazed, I thought COBOL is more American thing because they got computerized earlier.
>>
>>58359654
Cobol is practically everywhere. Around 80% of business programs are still in it (that statistics may be a bit old now, its from around 2008 i believe). Most of the Norwegian banks are on it.

Knowing cobol is ultimate job security.
>>
Why isn't all programming functional programming?
>>
>>58359923
Because in the beginning efficiency was held above elegance (correctness, beauty, whatever) and university gave in to industry demands.

Imagine how would programming look today if people listened to Dijkstra...
>>
>>58359888
What COBOL can you advise?
I heard only about GNU Cobol.
How do they take novices?
>>
>>58360369
Depends. Most of the industry runs on some legacy implementation or the other. Finding some code that conforms to today's standards is going to be impossible.

So learn any cobol you have easy access to study material too and be prepared to see way different language in production.
>>
>>58360061
>Imagine how would programming look today if people listened to Dijkstra...

>>only one entry and exit point meaning early return validation guards are not allowed


fucking awful is what it would look
>>
>>58360976
>>>only one entry and exit point meaning early return validation guards are not allowed
exception monad
>>
>>58360976
No exit points at all is even better.
>>
>>58360061
>Because in the beginning efficiency was held above elegance
how it should ALWAYS be.
aes over efficiency and you get python
>>
>>58363755
How is Python remotely elegant?
Thread posts: 71
Thread images: 6


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.