[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
/fpg/ Functional programming general
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: 63
Thread images: 8
File: haskell-fb-industry.png (1 MB, 1128x1080) Image search: [Google]
haskell-fb-industry.png
1 MB, 1128x1080
Ready for industry edition

Resources:

- https://storify.com/realtalktech
- https://twitter.com/realtalkintech

Latest articles:

- https://storify.com/realtalktech/what-makes-haskell-different
- https://storify.com/realtalktech/how-to-be-a-good-haskell-programmer
- https://storify.com/realtalktech/taking-down-haskell
- https://storify.com/realtalktech/haskell-has-no-benefits-is-good-for-nothing

IRC: #/g/fpg on Rizon
>>
>>54458797
Haskell is a decent language but shit for industry, let's be real here. 90% of "industry code" these days is reading and writing stuff to a database, with very little done in the middle. No one will use a purely pure functional language to do IO.
>>

public class Hello {
static class HelloWorldClass {
public HelloWorldClass(){}

public String getHelloWorld(){
String hello = "Hello";
String wordl = "World";
return "Hello World";
}

}

public static void main(String[] args){
HelloWorldClass helloWorldClass = new HelloWorldClass();
String helloWorld = helloWorldClass.getHelloWorld();
System.out.println(helloWorld);
}

}

>>
File: Wew_lad.jpg (34 KB, 550x550) Image search: [Google]
Wew_lad.jpg
34 KB, 550x550
>>54458842
>>
https://storify.com/realtalktech/why-did-haskell-fail-and-go-succeed
>>
paid to write haskell

ask me anything other than what's covered in the NDA
>>
Paid to shill with anti-FP articles AMA
>>
>>54459348
What's your job and what country do you work for?
>>
>>54459348 (Me)

Looking at that storify, damn people are so mad over whether Haskell is practical for use for money-earning projects

Too bad: the answer's yes, get over it. it's not as popular as many languages, but who cares? It's not a popularity contest

And we Haskellers are not calling for kufr to convert. Just that you should pay the jizya; a small levy for your own protection from type errors.

(/s)
>>
>>54459383
I do the full stack, from a Haskell web server backend, that uses a big Haskell library for /things/, to a HTML/JS frontend

I work for a private company, not a country, but I live in Aus
>>
>>54459465
>Haskell web server backend

You're building another chan aren't you?
>>
>>54459348
What experience do you have with other languages? How do they compare?

What are the real-world advantages/disadvantages of Haskell compared to imperative/oo/other functional languages?

Having had a job in Haskell, if given the choice would you prefer to stay or switch to another language?

I'm curious about Haskell, but just doing some investigation before getting invested (looks like may more investment than Clojure)
>>
Can someone explain to a moron what's FP about
>>
>>54459994
simplicity: almost no syntax, almost all code is semantic (once you get over all the parentheses, which literally will take you an hour or so); generally more concise.
(in lisps) all code is a data structure, so you can alter it at compile time with macros (metaprogramming)
writing pure functions (no side-effects) makes code easier to test and mantain; also makes big systems easier to reason about (but it's not that much of a deal if your imperative code uses sensible modules); once you've tested a pure function, it will always have the same results no matter what; you can also write pure functions in any language IF you have enough discipline (but real work happens in teams)
(many fps have) immutable data structures, which have great benefits for undo/redo and concurrent access
higher level: imperative works the more the way a pc works; functional works a little bit more how humans reason about programs.

cons:
exotic to imperative programmers
sometimes it's easier to cheat and write an impure function (with side-efects) and test it good, than write a proper tail-recursive function for the same task.
debugging for performance bottlenecks can be a bugger

neutral points:
OOP makes you reason in 'nouns', where functional make syou reason in 'verbs', which could be a better fit for whatever you're programming.

tl;dr: testability and maintaniability
>>
>>54459994
FP was about creating a new kind of hardware. It was supposed to be faster than Fortran.

The Lisptards, who didn't understand the reason for it, ruined the idea by using linked lists as the primary data structure.

Other functional languages began to be based on linked lists as well. They couldn't figure out why functional programs are slower and harder to optimize and why their specially made hardware is slower than an 8086.

Lisptards still believe you can create any language by bolting enough macros onto Lisp.
>>
>>54461314
>Lisp
>LISt Processing

Yeah, lol.

DSLs are great. Not for the sake of them, but for actual work.
>>
>>54459962
Not that guy, but Haskell is extremely comfortable to write because of the powerful type-system, ML-constructs, and backing theory that help you genericize functionality (ex: monoids, functor, alternative), in many cases removing the need for boolean logic, or rather because it sort of represents boolean logic with the bonus of data tacked onto the True and/or False values.

I think the slight controversy is in whether Haskell code is more maintainable because it's non-standard (i.e. not OO) and therefore "tougher" to grok, so newbies struggle. My personal opinion is that it's "tough" just because people learn OOP instead of FP and the paradigms are disconnected enough that you have to "relearn".

>>54460090
In Haskell you even have user-definable operators, specifically ($), which remove a ton of parentheses. For the clueless, ($) is defined as f $ a = f a, simply function application, so now you can write f $ g $ a instead of f (g a).
>>
>>54462959
Actually, further simplification: f $ g a
>>
>>54459528
Why would anyone choose Haskell over Erlang/Elixir?
>>
Why even bother with functional programming? It just all syntactical sugar
>>
>>54462959
>My personal opinion is that it's "tough" just because people learn OOP instead of FP and the paradigms are disconnected enough that you have to "relearn".
I don't buy that. FP was pushed as "the future" a decade before OOP was.

OOP became popular because it was a good fit for the GUI, multimedia, games, the web, databases, etc.

Backus's papers about FP were before any of that was mainstream. He was dealing with number crunching languages like FORTRAN and APL at IBM.

Number crunching needs to be fast and he said FP would be faster than FORTRAN and more composable than APL. FP was supposed to be good for array processors. There were already FORTRAN compilers for supercomputers that could do vectorization. Saying something is faster than FORTRAN is really a big deal even today.

But it's kind of a bait and switch. When people talk about FP, they don't mean something like that. They mean Haskell or Lisp, which have nothing to do with Backus's FP at all. Haskell is based on ISWIM, SASL, ML, and other languages. These languages were totally independent from FP but since they didn't have side effects (except for ML), they applied for "functional" grants and FP slowly shifted meaning. Lisp is an imperative language with goto and assignment which was "reinvented" as functional in the 80s after its use in AI failed.
>>
The only valid functional language is Clojure because it runs on the fucking JVM, industry standard.

>>54463242
Syntactical sugar directly translates to less bugs, less money and time spend on less code and less effort to maintain it.
>>
>>54463601
>Syntactical sugar directly translates to less bugs, less money and time spend on less code and less effort to maintain it.
None of that has to do with functional programming.

GHC has a lot of bugs and it's written in Haskell.
>>
>>54463322
I'm not sure how or if we're disagreeing.
>>
>>54463669
Could have been more bugs tho. Not language related? Have fun debugging multithreaded programs in C. No language ever claimed that, just some languages encourage good code.
>>
>>54463757
Universities were teaching FP before OOP was mainstream. FP was a failure because it wasn't good at anything people wanted to use their computer for.

So when OOP caught on, it's not because people were stupid or weren't taught FP, but because OOP was genuinely better.
>>
>>54463322
Backus' function-level programming is completely different than functional programming. They had nothing to do with each other besides similar names. Backus published his paper on value and variable free function-level programming in 1977-78. Lisp was developed in the 1950's. APL was developed in the 1960's. Functional programming is still value-oriented, and different than Backus' free function-level programming language called FP.
>>
>>54463761
>Have fun debugging multithreaded programs in C.
>the only choices are C and functional languages
You FPtards and your false dilemmas.
>>
>>54463822
OOP was genuinely better to understand for domain experts and the mapping from real world objects to Objects is far easier. FP was not used earlier mostly because it was considered less performant, something more and more irrelevant in our time. Compilers and interpreters optimize, not programmers.

>>54463871
Meh. Replace C with about any language that can produce side effects. It's not about languages at all.
>>
>>54458842
>not making the hello and world variables private
>>
>>54463869
>Backus' function-level programming is completely different than functional programming.
Now you understand the bait and switch.

He originally called it "functional programming" and his paper "Can programming be liberated from the von Neumann style" is the same paper cited by Haskell and sometimes Lisp users to say they're better than other languages.

"Functional programming" in Backus's papers meant "function-level programming" but now it means Haskell, Lisp, and sometimes JavaScript.

They take the alleged benefits of one thing (function-level programming) and say this completely different thing has the same benefits.
>>
Daily reminder that F# is the superior language and is truly ready for industry.
>>
File: 1461977738579.jpg (126 KB, 465x523) Image search: [Google]
1461977738579.jpg
126 KB, 465x523
>tfw fixed haskabelle for 7.10.3

Time for some formal verification
>>
>>54465393
Not really
I work with F# and the complete lack of attention and care Microsoft has for the language for the past 9 years makes it almost not worth the effort
>>
>>54465630
>lack of care
>version 4.0 released less than a year ago
> first-class support in Visual Studio
Sure thing kid
>>
>>54465810
>>54465630
I will say, I have friends who've worked at Microsoft and they've said that F# is basically ignored other than by 2-3 people. Microsoft isn't putting much work in there beyond what you've seen so far (i.e. no obvious plans to make it a first-class .NET language).
>>
File: 1438785232074.png (266 KB, 313x396) Image search: [Google]
1438785232074.png
266 KB, 313x396
>>54463761
Is this supposed to imply debugging multi threaded C programs is hard?

>he can't into pthread and mutex
>>
>>54459528
no, not even
>>
I've used Haskell for 2 courses at university (one general FP course and one languages/compilers course) and I was pretty good at it. I also loved how nice and concise the code could be. But I struggle to see how I could use it personally for practical projects. I want to do cool shit with interactivity and graphics (i.e. mostly games) and FP doesn't seem all that suited for it.

Once I learned C++ I kinda stuck with it (even though I already knew C#) and I've been using that exclusively for the past 2 years or so.
Luckily I can use FP somewhat in moden C++ so I get some of the neat code constructs, but it's still not completely there. Plus the often horrible syntax is a disaster compared to Haskell.
>>
>>54465893
>no obvious plans to make it a first-class .NET language
But it already is.
>>
File: 1462723491590.jpg (282 KB, 960x720) Image search: [Google]
1462723491590.jpg
282 KB, 960x720
>>54458797
>functional programming
>>
>>54466035
You can use mutable state in Haskell too if you want to, while you still have the nice syntax, ML-constructs, type system, and so forth. Plus Haskell's separation of I/O and pure functions/values means its STM implementation works flawlessly if you can't be arsed with Mutex locks.
>>
File: 45236499_p0_master1200.jpg (134 KB, 400x400) Image search: [Google]
45236499_p0_master1200.jpg
134 KB, 400x400
>>
>>54459011
When did go succeed?
>>
>>54458842
public class Client {
public static void main( String[] args ){
System.out.println("Hello World!");
}
}


>hurr Java sucks
>>
>>54469151
IO.puts "Hello World!"


It sure does.
>>
>>54469204
x = 5
x = 6

Where is your god now?
>>
>>54469204
It has it's place you smug bastard.
>>
>>54469289
Where's yours?
>>54469293
It sure does, in the garbage.
>>
>>54469360
And now try the same in OP's so loved Haskell
I sure love creating a new data structure everytime i want to insert/delete something
>>
>>54469491
Sorry
>>
>>54469204
because hello worlds are really useful
>>
>>54458797

is node.js functional programming
>>
>>54470053
yes
>>
>>54470053
no
>>
>>54459348
How much of your code has side effects
>>
>>54463601
there is also Scala (JVM) and F# (.NET and interop with C#)
>>
>>54463822
the only good thing about OOP was interfaces
>>
>>54465893
they are literally working on .NET native for it as well m8
>>
Mind if I interject with a Scheme vs Clisp question?

I have recently learned some Scheme and like how it is really similar to lambda calculus. But I noticed more of the literature on lisp dialects and for that matter functional programming in general seems to be written with Clisp in mind. I don't think I have the time to really delve into both so.

Should I switch to using Clisp so that I can have more readily available literature, or should I keep searching for advanced nooks on Scheme?
>>
>>54472606
CL isn't considered functional by a lot of people (while Scheme usually is). Lisp material will usually focus on CL since it has the biggest community, but more FP-focused things will deal with Scheme (SICP, etc.). If you're interested in FP then I recommend going with Scheme (or Clojure), but CL is nice if you just like the whole idea of using a Lisp and want to write bigger software with it.
>>
>>54462981
couldn't you also do f . g a?
>>
>>54469491
You don't actually 'really' create a new data structure each time. They use some smart linked lists that can share data.
Thread replies: 63
Thread images: 8

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.