Guys I want to learn functional programming and LISP, what resources should I use?

Guys I want to learn functional programming and LISP, what resources should I use?

Attached: 04a1a608647beeeaa60828b71c1b0cd9.png (1538x2048, 5.81M)

Other urls found in this thread:

ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures/
htdp.org/
tutorialspoint.com/lisp/index.htm
twitter.com/NSFWRedditImage

That's a shitty imperative language with tons of mutation and state. Try Haskell instead.

I wanted to try Haskell but the syntax looks way too complex when I barely understand functional concepts.

SML is the most attractive one, I think. There's mercury too, if you want to go Prolog.

Is that image meant to be a comment on functional programmers? I don't even know where to start.

Attached: serveimage.jpg (379x500, 32.07K)

Can't Scheme be used in a purely functional manner?

No I just like cute girls

I already learnt C

That doesn't explain the image

I'm not OP, but not really. Scheme doesn't have any means of doing IO in a purely functional way, it doesn't even have types. It's still a wonderful language to learn and it can serve as a introduction to writing functional programs but not really for actually writing complex purely functional programs. If you are really set on a purely functional language I've heard good things about Elm and Clean as far as simplicity goes but there are quite a bit more learning materials available for Haskell. If you still want to learn Scheme the book attached is the standard as well as these lectures:
ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures/
Alternatively there is the new version of SICP which is supposed to be much easier to learn and more pragmatic, I sadly don't have a pdf copy of this one you can get it online for free here: htdp.org/

The syntax is no more complicated than python that every idiot seems to understand how to use

Somewhat but so can assembly.

Elm is more limited than even go.

SICP. You can use Dr Racket to run your programs. Get the specific SICP scheme dialect plugin for it, and you're good to go.

Htdp isn't really a "new version" of SICP, it's just inspired by it, and supposed to be easier. SICP gets pretty hard sometimes.

It seems there is no common lisp coder here at all (what a surprise Zig Forums is full of larpers since around 2 years).
If you already know how to code, and want a quick rundown, then read Practical Common Lisp (PCL). If you don't, and want to take more time, then go for "A gentle introduction to symbolic computation" (I reall liked this book, it explained very well how cons cell works).
SICP is about scheme, so it's not the same. Now, maybe should you read SICP, then get to know common lisp through PCL. But SICP is an hard read compared to PCL.
You easely can switch between elisp, common lisp and scheme, if you know one of them.

After that, there is other book, like Lisp in small pieces, Let over Lambda etc...

Download the CLISP compiler and environment.
You can start here:
tutorialspoint.com/lisp/index.htm
You can use notepad++ with Lisp language as an editor.
stay away from Emacs. It's a masochism machine

There's no denying Haskell is a great functional language, but it's not a "beginner" functional language. If someone hasn't done fp before, it can be overwhelming . Let him start with Lisp .

Attached: lisp-programming-languge-2-638.jpg (638x479, 64.41K)

It's not that complex. The many operators and few parentheses do make it hell though until you understand the precedences. Lisp looks like hell too but at least it's really obvious how the expressions are grouped.

it's not the syntax, it's the way people write it. A typical CL programmer will try to write clear code. A typical Haskell programmer will try to avoid variable names.

Variable names are bloat.

If it makes you feel.any better, practical common lisp is next on the list after I finish SICP. Everything I've read leads me to believe that common lisp is more practical for real world applications, and not just because of the libraries.

'Functional programming' means three things:
1. ML and its children. You got your variant type constructors and advanced type system and type inference. You got your homogeneously-typed lists. You got your pattern-matching. You got everything written in the language being an expression with a value. If not for #1 nobody would give a shit about FP. Even Haskell's appeal is mostly due to its ML elements.
2. masturbatory Haskell bullshit: anti-features, non-features, and category theory. Imagine if Japan's first contact with the west were with a coven of fucking witches. Japan: "woah these sea-barbarians have all kinds of amazing wisdom, knowledge, and technology -- and also they're completely degenerate nutballs! It's too bad you can't have one (ML) without the other (Haskell) :( o Mistress Pink, please teach me how to properly set up altars while sky-clad and also how your guns work."
3. "using functions as first class values" - which is how anyone ever came to speak of Lisp and FP in the same breath, even though you can't take a deep breath without inhaling a few dozen languages with first-class functions.
if you want to learn Lisp you've gotten some advice here already.
if you want to learn FP take a look at ReasonML or Elm. Probably the easiest possible starts right now. Focus on making stuff productively, and occasionally ask (here, on a code review site, in Reason/Elm fora) if you're doing it right
if you want to learn #3 FP and would prefer not to confuse that minor task with learning a new language, then your options depend on what you know. for example, if you know Perl, then Higher Order Perl is pretty good.

There's no common lisp coder anywhere. That's why it's a meme.

lol okay retard. common lisp is the most imperative piece of shit ever.

ML is totally inferior to Haskell lacking basic runtime features and higher kinded types.

Common Lisp is functions, it just doesn't enforce functionality.

Erlang is even better at this. It tries to be functional, but when something gets impractical or complicated because of the functional paradigm, they have no qualms about just abandoning it.

s/functions/functional
My fault for being a phone poster when I know better.

Yeah so is c++ faggot. Languages have lambda and all of the sudden think they are a functional language.

Come on man, I appreciate the help but do you really think anyone here uses Windows?

I want to learn FP but ReasonML and Elm are web languages I can't come up with a practical use for.

You didn't quote the whole thing I said "I've heard good things about Elm and Clean as far as simplicity goes" also GO is a wonderful language so long as you're in a use case which can handle GC stops (most applications) Elm in my mind is useful for two things teaching FP and maybe writing UIs.

This is true, I did SICP spread out over the span of a year including a summer as a NEET. I honestly think anyone can do it with enough time and tenacity but that's not something must people are at the liberty to have which is why I suggested it. Not sure why I used the term new version, perhaps to give it creditability so that new folks don't get overwhelmed by SICP and think SICP is the thing everyone starts with.

This is good advice, because Common Lisp is a more complex standard than Scheme I think I would suggest learning Scheme first, but not through SICP. Htpd I think is the natural choice for a novice in todays age.

Functional programming seems more like a style to me and a gradient of languages which make that style necessary or convenient. So in Scheme you primarily work with recursion with, anonymous functions, and with map/filter to write your programs, state is only introduced when "necessary" do to the flaws of the language in a rather poorly isolated way.

I don't think you're going to find something purely functional, general purpose, well documented, & easy to learn. The best you're going to be able to do is compromise. Elixer might be a possibility, Scheme might be one, Haskell might be one, ELM might be another, maybe even a Ocaml or F# (but probably not).

Holy shit you're retarded. You obviously know Jack shit about Erlang nor C++

Did you actually want resources or were you just trying to initiate discussion?

Until you come to the part where you need to install the "Foo" library and want to strangle either the author of the book or the author of the library. This has to be the most un-searchable name for a programming library of all time. And the book is not really that great, it glosses over important things and wastes too much time on trivial things.


Is there a reason to recommend Good Goy Lisp over SBCL these days?


Common Lisp is as functional as its implementation makes it. Since tail recursion is not mandated by the standard you cannot rely on it being there (even though it usually is), leading people to favour imperative programming.

Nice argument fuck-wit.

Retarded. A so called "functional language" where you cant even rely or recursion being implemented correctly.

Tail recursion is an optimization detail, it's not necessary for the logic of recursion.

You sure as fuck won't be writing functional programs if your stack is blown every time you calculate the 200th Fibonacci number. Brain fuck could be used for weather prediction on a super computer. It's just an implementation detail after all.

Recursive programming should be avoided anyway as tail call optimization is rarely present in languages and implementations. Javascript, for example.

He was talking about ML derivatives knucklehead

The ML derivatives are even worse you retard.

Ah yes NON FUNCTIONAL LANGUAGES lack FUNCTIONAL LANGUAGE FEATURES. Wow that sure is confusing.

Your programming skills suck if you blow your stack with trivial recursive processes. I'll forgive you if your processes beyond the trivial.

Still better than anything I've ever seen Haskell doing. Some ML derivatives are actually used in code bases I've actually seen in the real fucking world, asshat.

Do you even have a basic understanding of how Stack Frames are implemented in almost any programming language? Do you even fucking understand what Tail Call Optimization is? ANY recursive code will cause a stack overflow if not properly optimized. Now go fuck off stupid ass LARPing son of a bitch.

Yes because Javashit is the arbiter of what good optimized code looks like.
Did you even read what you posted?

Guess I'll just grit my teeth and go for Haskell then.

Both, though the discussion was secondary.

If you actually want to get a job learn OCaml

It's more rare and limited across languages than you think. The better CS schools teach you to avoid it.

Getting a job isn't really a concern for me

how about handling all of facebooks spam prevention is that good enough for you? trillions of events per day.

Literally all recursion blows the stack in these shitty non functional languages unless you implement some retarded trampoline system like on the JVM.

it's for the best. I would recommend "the haskell book".

this

only in eastern europe where you make 2 euro an hour

for jobs its everywhere, in actual CS its nowhere.

Depends what job. I'd try to do better than something that a streetshitter could apply for. E.g. you won't find that kind of deeply recursive call in the kernel.

Because it's written in c the most bug prone language ever made. Where one trivial memory error causes remote code execution.
Ah you mean like C and Java.

*tranny

If you're at the point where you think anyone remotely feminine is a tranny you should reelvaluate your sexuality.

Attached: BOBBY.mp4 (144x144, 237.2K)

user, it's $CURRENT_YEAR, it's OK to admit that you are into Jewish trannies.

Good choice. ML beats the shit out of Lisp, and Haskell has the most learning resources of the family. You also get laziness, enforced purity, and some applied category theory.

Dodie is literally the height of femininity, you're clearly a faggot

Attached: 7f48dcea-9a99-4112-8cd4-51f46a09e113.jpg (660x371, 18.14K)

Actually, it's a multiparadigm language. You can write in purely functional style, or purely imperative style, or mix and match as you prefer.

s/discussion/shitflinging show/
ftfy

...then you've probably lurked teh 'chans for too long. It's true more often than not around here.

The syntax is fairly simple. I think you are confused about what some functions do rather than the syntax.
Most concepts are easy to understand, but everyone gives poor explanations which makes them seem hard.

I learned lisp back around in 2007, so I haven't heard of it.

It seems hard because everyone keeps trying to explain it in terms of maths.

user, I was using SBCL in 2001. You never heard of SBCL because you didn't join #lisp on Freenode.

How many children does she have?

Don't be so hard on Haskell.

Monads and Cat theory is necessary to make sure all that type stuff from ML is actually composable and semantically correct. And when it comes to modelling parallel programming, you can't compare the power of Haskell monadic based IO to Ocaml's ref pointers.

Also there is the GHC, Haskell code is already faster than Java on most cases. And for a lot of parallel software Haskell is already on C-like levels of performance.

15

Just like c++, d, javascript, every other shitty languages that claims to be multi paradigm. AKA it's not.

Worst forced meme ever. Only true for programs almost not using the heap.

Actually moving garbage collectors are faster for programs that actually do use the heap. Tiny shit programs everyone runs barely use any memory. When you get a server with a half terabyte heap a moving garbage collector becomes incredibly beneficial. Even without the fact that c programs leak like a bitch the fact that you need pointer stability is very damaging. There is a reason all the big data processing enterprise applications use java.

That's obviously wrong, unless you mean that the overhead matters more for tiny programs.
Over what? GC performance is always a race between throughput and latency; you'll always get fucked somewhere.
C programs don't leak, bad programmers create leaks. Very bad programmers when you see that tools like lsan or even valgrind makes it very easy to resolve.
What do you mean?
The same reason python or javascript are used almost everywhere now, including in some performance sensitive contexts. Big data is the most entreprise buzzword there exist, of course they'll use a programming language as industry memed to implement it. The meme "Java is as fast as C" is the one that started the joke, too.

Garbage collection is absurdly inefficient.
Because they massively outsource development and rely on Java to keep the poo in the loo. It's incredibly slow and bloated but hardware is cheap and developers are expensive.

...

You have have no idea what I even said and are now throwing shit all over the walls.

I'm fully aware you're a moron and are posting your "c programs leak like a bitch" tears via several hundred million lines of C.

If it's having to expand out over more cores, it isn't as fast as that program that doesn't, it's only taking more resources to get to the same end goal, which is a fancy way of saying that it's slower.

Ah the c fag is triggered by the fact that his language is a hand cannon responsible for a metric fuck ton of trivial errors made daily by even expert programmers with decades of experience. I just love when someone appends 2 strings together incorrectly leading to remote code execution.

Except when c leaks memory everywhere and fragments the heap leading to slower performance with actually large amounts of data.

You can answer, you know. As much tuned as your curry magic (incredibly complex bloat, I'm sure you like this) is, it's still not used where performance matters. No, Big data isn't actually trying to be performant, it's trying to exploit naïve parallelism because it's easier than to write a clever algorithms.
Just dumb entreprise big wigs discovering HPC and creating a bad meme.

PHP is a memory-safe language yet is responsible for far greater damage. Let that sink in, webdev.

Go back to microcontrolers faggot where you're 2kb of memory matters.

That's what evaling strings does. I fucking hate PHP. Probably as much as I hate c.

Nice opinion, fagtron.
Everyone knows about pooling, retard. Well, everyone not using a toy language where allocation is done by mommy (for a price).

Thanks to your kind, normalcattle is rocking smartphones with 8GB of RAM and more cores than my laptop.
Also, GC doesn't only have a cost in RAM, but in CPU, which is never free.

C programs _can_ have vulnerabilities. The JVM has tons of them, and you can't do anything about it.

oy vey goy just stop using malloc that will solve all the shitty problems with c!

If you're having fragmentation problems in C you're doing it wrong.

Or just use a good malloc like jemalloc.
Get your meds, nobody's interested in your persecution complex. Nobody who has written C will say that it's perfect: it has big flaws (no real array support, no generics, stdint isn't used by the stdlib, unicode handling is shitty) but it's simply not as bad as the others where resources are wasted because they're here and programmers treated like poos who need their hands held. I won't even talk of the bloat (incurring complexity, bugs, unease of porting and other problems) of the other languages' runtime (inb4 gcc is a big fat shit, tcc and pcc exist).

You c larpers who i'm sure are either students or have never developed anything sure have amazing opinions of the language and its capabilities found by literally no experts.

I've been writing C/C++ for 25 years, qt.

Ah then you must agree with all the other c experts that c is prone to buggy shit.

Not that much more than anything else. Like, if I'm writing something super delicate like writing cmsg goo or netlink messages I'm not going to be magically saved from logic errors in all that mess by switching to rust. There's a pretty thin set of errors it promises to improve and those tend to be rare. Not that I wouldn't like to have a better C, I just don't think it exists yet.

Gradually, I started to hate them.

...

There was no argument to respond to. Faggot.

And in all these "wonderful" languages, it's just a branch for each access, just to check that you don't overflow. I'm sure your disgusting kind will be the perfect market for autonomous cars.

That's why you don't make retarded claims like "c programs leak", faggot. Here's a C program that doesn't leak:
int main(void){ return 0;}
Anyway, who cares about you retarded toddlers whining about C while never accomplishing anything that isn't pure garbage in your babysitting languages?

Exploitable issues like that are rare enough today with 64 bit ASLR that language-specific issues are no longer the main concern, at least in my field. Again, I'd love to be rid of them entirely but there is currently no alternative.

LOL

oy vey o program that does less than hello world does not leak
you mean c?

*ASLR

If you're not aware, it cut the number of exploitable pointer errors down to such a low number that language-neutral coding errors have become the biggest threat. I do a lot of packet surgery and those pointers remain entirely in bounds while still potentially opening up all sorts of security holes.

ASLR is great and its an amazing piece of technology. It also is a far cry from fixing remote code execution vulnerabilities.

ASLR does not reduce the number of exploitable errors it simply makes the errors that exist less likely to succeed consistently.

Any little information leak and your ASLR ends up useless.

Yeah, but there's often not enough space to upload complex methods that rely on the branch target buffer and a server isn't running a web browser. In practice, it's reduced the number that are exploitable.