>Theory SICP Essentials of Programming Languages Practical Foundations for Programming Languages: cs.cmu.edu/~rwh/pfpl.html How to Design Programs: ccs.neu.edu/home/matthias/HtDP2e/ Art of the Propagator An Introduction to Functional Programming Through Lambda Calculus
Fucking solid. Thanks! Taking the dive into either Haskell or Common Lisp, I need some time to think about it as I only like to focus on a language at a time.
Robert Long
Which functional programming languages do you use Sup Forums? Do you study category theory?
Andrew Wood
Do languages I tried to learn count?
Ayden Lopez
LINQ ought to be enough for anybody.
Nolan Rivera
>muh monads you make me sick
Ryan Brown
>tried What do you mean "tried"?
David Brooks
I use C#. Sell me on functional programming.
Isaiah Sanders
Anyone got experience with Clojurescript? I was gonna use it for my web thing so I don't have to deal with JS (also, macros might come in handy). I have lots of experience with Racket but no experience with clojurescript, and when I initially tried to set it up it seemed like a hassle and a lot of overhead just for a simple script. Is this true? Is it easier than I think? Right now I'm regrettably leaning towards typescript because it will compile into a .js file with a single command in a makefile
Connor Russell
do we have an IRC?
Michael Lewis
Do or do not, there is no try
Ethan Edwards
LINQ is FP
Xavier Watson
It's less boilerplate than OOP. But you have to learn it to judge for yourself. Also those "if it isn't pure it isn't FP" assholes need to shut up, it's fine to be impure and pragmatic every once in a while.
Gavin Stewart
FP doesn't have to be pure, but pure FP is better
Nathaniel Torres
Elixir is just a meme amongst Ruby people right?
Lincoln Sanchez
1. It's fun. 2. It shows you another way you think about a problem, improving your ability to write oop 3. Its more concise than oop. 4. Its faster than oop.
Nolan Diaz
Learning Clojure is not 'pragmatic' in any sense of the word.
Joseph Stewart
>Sell me on functional programming. Do you use LINQ?
If yes: Congratulations, you're already programming with some functional elements.
If not: You're not using C# correctly.
Kayden Phillips
But if I can use linq for areas that are helped by FP and I don't need to use it otherwise, why would I program in nothing but the FP paradigm? Linq is great but I wouldn't want to use a similar system for everything.
This may be me being a retarded babby but pure FP confuses the shit out of me, the concept of OOP is just much more intuitive and easy to work with.
Falling too deep into ~~~~~~PURE ENCAPSULATION INFINITE INHERITANCE GETTERS AND SETTERS INTO INFINITY~~~~~~~ from java is obviously a waste of time but languages like C# seem to get around that.
Good points, especially 2. Any languages you'd recommend me to start with? Also, how is 4 true? How could it be any faster post-compile? (or do you mean to write)
Joshua Ramirez
try F#, there's a tutorial as a VS project template
Chase Parker
Karen, nobody fucking cares, go kill yourself you weaboo scum.
Brayden Bell
What is your favorite ML and why?
Jayden Stewart
>Falling too deep into ~~~~~~PURE ENCAPSULATION INFINITE INHERITANCE GETTERS AND SETTERS INTO INFINITY~~~~~~~ from java is obviously a waste of time but languages like C# seem to get around that.
nigga what kinda fucking hypocrite are you c# encourages encapsulation everywhere the only thing c# does better in regards to inheritance is methods being final by default, which is still fucking shit c# encourages getters and setters a lot more than java, properties even worsen a lot of the negative aspects of getters and setters (now it even looks like a member!)
Nolan Harris
>PURE ENCAPSULATION INFINITE INHERITANCE GETTERS AND SETTERS INTO INFINITY But that's what OOP is
Colton Perry
If F# used enough by developers ? As M$ is more a C#/shitty VB.Net thing. And is it decent compared to haskell ?
Jack Long
I would normally say having a language on top of js is not worth it... but typescript detects type errors, so it seems alright
Levi Ramirez
it's paid well and there are jobs for it, it can interface with C#
>compared to Haskell it's nowhere near as good
Levi White
>why would I program in nothing but the FP paradigm?
You wouldn't. You shouldn't.
C#'s LINQ is the most accessible, useful, makes-sense-in-the-real-world application of functional programming that exists.
Justin Powell
Don't use F# if you're complaining about Microsoft.
F# is no less a product of Microsoft than C# is.
Better to move to C and implement your own functional features, because Haskell is a fucking meme and Scala is shit.
Cooper Richardson
go to bed bill
Leo Cox
>c# encourages getters and setters a lot more than java, properties even worsen a lot of the negative aspects of getters and setters (now it even looks like a member!)
If you think that public string myProperty { get; private set; }
accessed with string foo = other.myProperty;
is just as easy to write and nonbloated as private String myProperty;
public String getMyProperty(){ return this.myProperty; }
accessed with string foo = other.getMyProperty();
then we'll just have to agree to disagree because you won't ever be able to convince me that they are equal in terms of usability
Nathaniel Reyes
Haskell is great
Wyatt Collins
bill gates doesn't give a shit about C#, and Microsoft was disgusting under his and Ballmer's direction. Nutella may be a pajeet but they're open-sourcing everything these days
there's even rumors that Mono and the full .NET Framework are going to converge and be open sourced
Joseph Wilson
Volunteer OCaml shill reporting in.
Dominic Foster
dude, learn FP, I used to hate it but when you grasp it, It will blow your mind.
>mfw finally learned FP
Camden Williams
Even though I complain about M$ (calling it M$), I respect their dev tools and C# (but VB.net)
Anyway, why haskell is a fucking meme ?
Blake Garcia
friend the problem of getters and setters isn't that it's hard to write them you fucking autist
Isaiah Gray
Not quite. It's becoming a meme amongst web dev people because Phoenix is a lot saner than the other large web frameworks. They're starting to realize that maybe the object-based approach of Rails and Django isn't the best match for the problem domain. I don't think the really hard core rubyists are in a rush to switch to Elixir. It imposes a lot more discipline on the programmer than Ruby.
I've seen some Erlang devs look into it, too, but Erlang devs are too few to make an impact on the memeosphere.
Carter Barnes
It's not that they're hard to write, it's that they (specifically within java) bloat the shit out of your files for 0 reason. There is nothing wrong with accessors.
Hunter Davis
You're in a FP thread.
90% of their focus is on how succinct it is to write something.
Jackson Reyes
>bloat the shit out of your files oh no, 0.03 megabytes, whatever will my hard drive do?
Mason Rivera
>there's even rumors that Mono and the full .NET Framework are going to converge and be open sourced And what's the profit then? It's not like I like .NET, but they are alien to any non-Windows environment. What's the point? Meanwhile, 3 billion devices run Java.
Angel Smith
It's less about the size of the file and more about the fact that you either have a big fat tail on your file or you have a bunch of shit in the middle that you have to deal with
3 line getters and setters are ugly, and you can't convince me otherwise. Even if you edit your IDE or text editor to autoformat them as one line, it's still way more than there has to be.
Why are javafags so defensive?
Michael Reyes
add = (+) I am doing Functional Programing!
Joseph Green
He was clearly not talking about memory, but more on readability/maintainability. Expressing code in fewer line = less error prone and more readable.
Ian Powell
Can you explain how web frameworks are sane any way? I usually hack something together myself.
Brody Jones
Programming and writing meaningless code are not the same things
Jayden James
>Better to move to C and implement your own functional features I mean, that's a fine solution if you're a NEET and also barking mad. However, you could also just use OCaml or Standard ML compiled with MLton if you want to avoid Haskell.
Joseph Hernandez
>Why are javafags so defensive? They're used to it. They live in a bloated environment (Eclipse) all day long, writing bloated programs.
Aiden Powell
>if you want to avoid Haskell why would you want that?
Asher Morris
>There is nothing wrong with accessors. can you not think of a single reason ask yourself any of the following questions: - is it intuitive that an accessor is suddenly very expensive? - is it intuitive that an accessor changes its api to suddenly throw an exception? if you can identify something clearly as an accessor as opposed to just a "regular" method, you make fairly strict assumptions about what it does. these assumptions actually limit the changes you can make to the accessor without caller code unintuitively breaking. this is worsened with attributes because they completly hide the difference between accessors and members.
Ryder Kelly
I don't know. I thought I'd give a practical suggestion for people who, for whatever reason, consider Haskell "a meme".
Christopher Nguyen
>And what's the profit then?
Look at it this way:
I'm a .NET developer. I started using C# because it looked pretty easy to read and straightforward. I've fallen in love with the language over time, and I've started to really take advantage of the features. I know many libraries that help me actually get shit done and make clients/other stakeholders happy because I produce results.
Recently, I decided I needed some cloud services to move some data and also implement some machine learning/cognitive APIs like image recognition. Azure has 10/10 .NET SDKs for all of their services, so guess which cloud platform I used?
Xamarin is now free and open source. Azure has an all-in-one mobile service package that gives you a backing database, an endpoint, and a push-notification broadcaster and they even wrap a ready-to-go solution file that's configured to work with these services. 15 minutes later, I've got an app debugging on my Android phone that actually pushes data to a user account backed by an Azure Active Directory.
You can love or hate Microsoft, and I know I sound shill as fuck right now, but god DAMN they are making great tools easy to work with.
I'm employed and I nearly exclusively Microsoft on-prem and Azure services. Ask me whatever if you want to know how deep the rabbit hole goes.
Grayson Gonzalez
>expressing implications with = fucking normie pleb kill yourself
Christian Taylor
congratulations user-san
Isaac Thomas
>mfw user does a functional programming
David King
>I would normally say having a language on top of js is not worth it What do you mean by "not worth it"? Typescript feels like OOP boilerplate shit right now and I'd like to avoid all of that if I can.
Luke Fisher
It's not even that. Every get/set is a FUNCTION CALL. That means that, whenever you want a value, a call frame has to be made. It's not just code bloat, it affects performance, even if only marginally.
Carson Miller
Replace "=" by "is more likely to be" if you want, or is that too hard for your remaining neuron ?
Jeremiah Morgan
typescript adds a little sanity into javascript
Brody Bailey
nigga = is a symbol used for equivalence, not implication were you implying that less error prone and more readable => Expressing code in fewer lines, huh, you dumb piece of shit human waste? >neuron ? go fuck yourself
Cameron Collins
That wouldn't be a major issue if the reason was only a performance hit of such small scale IMO
Noah Lee
Why not?
Jack Howard
Okay, replace = by => if that helps you sleep better. I wasn't doing math though, and my sentence was understandable enough. Now shit a little and relax.
William Thompson
i fucking hate shitfucks like you that missuse symbols that have been in use for hundreds of years because your fucking middle school tier math knowledge only taught you the equals symbol fuck you kill yourself
Jackson Bailey
A web framework (or a set of web libraries designed to work together) contains a lot of code you'd write every time when building a web application from scratch. If you manage many similar projects (e.g., you are a contractor working for several companies), it makes sense to maintain one framework instead of N instances of similar code.
A good "full-size" web framework made by somebody else distills many hours of its developers' professional experience in building web applications into code. What that means in practice is that it encourages sound architectural decisions and prevents you from making the kind of mistakes its developers made in the past. On top of that you don't have to maintain it yourself and hunt for the tons of minor security issues that are the norm in web development.
A big downside is that most of these frameworks are highly dynamic (even relative to the baseline for their host languages). This makes debugging a pain. Additionally, migrating code from one major release, e.g., Rails to another isn't trivial. This is where Phoenix shines by doing a ton at compile time.
Daniel Torres
>= is a symbol used for equivalence Equality is not equivalence you dumbass
Camden Harris
the problem is, you now have to manage two languages: javascript and the other. so you program in this lang, then you have to compile to js and then use, that's another dependency, and then you might still need js, e.g. if you are doing tests in the browser console and there is an error it will tell you the line in the js file. Basically you have to learn/use the syntax of two languages. The first language I tried that on was CoffeeScript which is intended to make js shorter, adds syntax sugar and fix some design issues. But is it worth it when I could just use js? I'm using js functions anyway, just writing them in a different syntax. I got meme'd hard. As for typescript, js being dynamically typed really can lead you into problems, detecting type errors could be a big help and their approach to oop seems sane; defining an interface seems simple enough.
Angel Lewis
somehow I accidentally deleted my mention of CoffeScript's fucking whitespace rules
Easton Adams
OK, fair enough. I think I'll stick to what I'm using. The point about testing in the browser is a good one - live debugging clojurescript by poking it with javascript is probably a nightmare. Other than that I don't really care about extra languages; I've already got like five (jesus) -- Python, Jinja, SQL, HTML, CSS.
But I'm probably going to end up writing a script that auto generates typescript/javascript code since neither languages have macros...
Parker Mitchell
If you're in this thread, CoffeeScript probably isn't going to do much for you but LiveScript may. Look at livescript.net/.
Elijah Reed
Moreover you can just make them inline to avoid creating the function frame (at least in C++). Hepefully the compiler automatically does this when apropiate.
David Ramirez
LiveScript looks like a huge meme, I dislike languages that are primarily flowery syntax and sugar. I write Racket which is mainly about being very straightforward and consistent, rather than being pretty or concise
Why would you write a functional library for a non-functional language?
Jacob Davis
Alright, got faced with an interesting functional programming problem this week, curious about how people here would choose to solve it if they were trying to do it as functionally as possible. So, I wanted to build a function that took a series of files and return as many as possible while the total size is under a certain amount. What would you do?
Anthony Bennett
Someone earlier mentioned category theory being used in functional programming. How is it used? t. Someone who knows category theory but no programming
wow x = x, check a = b b = a, check a = b & b = c => a = c, check
Colton Garcia
>functional programming problem no
var muhFiles = Directory.EnumerateFiles(path, "*.*", SearchOption.AllDirectories).Select(x => new FileInfo(x)).Where(x => x.Length < muhSizeInBytes);
Christian Walker
>x => new FileInfo(x) can you not just do FileInfo ?
Josiah Foster
It's clearly using the constructor for the FileInfo object, thus the new keyword.
You're welcome to write some autistic extension method that will make this line 3 characters shorter.
Bentley Ramirez
OOP + FP is a match made in heaven.
Lincoln Hall
every time you write a struct, define a free function fileInfo = x => new FileInfo(x);
it will be much more readable
There is literally no OOP in that picture, unless you think method notation = OOP
Aiden Young
You could do that if FileInfo() was a method that accepted a string.
This is an object constructor, though, and an object constructor is not a method.
Leo Russell
>every time you write a struct Excuse me?
Xavier Cooper
Whenever you create a new struct type, write a free floating function that constructs it
Alexander Rivera
>a new struct type :^)
Isaiah Lewis
>There is literally no OOP in that line of code that make use of an object constructor, and no less than two other objects and their static methods
Alexander Thomas
So constructors (aka functions that return something) and method syntax (aka functions that accept an additional hidden parameter) are OOP now?
Jayden Phillips
>constructors (aka functions that return something) This is incorrect. A constructor is not a function.
>method syntax (aka functions that accept an additional hidden parameter) You have a fundamental misunderstanding of LINQ and what it actually represents.
This is the last response you'll get until you do some research and ask a question that is based on some understanding of what you're talking about.
Aiden Sullivan
>A constructor is not a function Right, because in your particular language it's different, that means it totally doesn't share almost everything in common with what one would call a function.
>You have a fundamental misunderstanding of LINQ and what it actually represents. I wasn't talking about LINQ
Easton Gray
Because you'll have to hack together everything, even write your own libraries for shit you don't want to be writing libraries for.
Christian Cox
u d 1 tlk 2 ! ch
Jonathan Brown
How would one write a compiler for a functional language? Are there other systems than lambda calculi usable for such languages?
James Flores
What part are you confused about?
Charles Adams
The part where I can't really see how I would put functions on the stack when calling or returning them from higher order functions like you would do in imperative languages for example.
Caleb Cruz
What do you mean?
Wyatt Campbell
Let's say I have something like (ML syntax) let f g h = function x -> (g (h x)) Now I do a call to a partial binding, how do I return it?