Fork me on GitHub
#other-languages
<
2018-04-17
>
borkdude15:04:37

> Although Scala was never really designed for functional programming, a carefully chosen subset of the language has proven adept at real-world functional programming. http://degoes.net/articles/scalaz8-is-the-future

dpsutton15:04:15

i thought scala was designed to be a functional language on the jvm

sveri15:04:50

AFAIK it is a "one to rule them all - finally" language. Except logic programming maybe.

dpsutton15:04:12

oh ok. i thought it was trying to be haskell on the jvm

dpsutton15:04:27

(never used it)

borkdude15:04:27

@dpsutton if you want that take a look at Eta or Frege

dpsutton15:04:49

i've got my language on the jvm 🙂 just what I understood to be its motivations

borkdude15:04:11

the Scala problem is that it can be anything to anyone, so among teams you will have to decide on a certain style and have thorough code reviews to prevent things to become a mess

👍 8
sveri15:04:36

The motivation was to have a better Java. Martin Odersky left Sun to implement the stuff he thought java needed.

sveri15:04:04

He was the guy that implemented generics in java, for instance.

borkdude15:04:52

generics in C# were first implemented in F# I believe. Language nerds who are ahead of the game

sveri15:04:20

And then there are the language nerds that say: "our freshmen all come from university and we have a lot of them, so lets not put them through learning to use generics".

borkdude15:04:05

do you mean a lot of juniors don’t know how to use them?

sveri15:04:31

No, That was the reason why go does not have generics. Because they wanted a language thats easy to use.

borkdude15:04:52

you can also use dynamic typing for that 😛

borkdude15:04:21

I think Scala also supports higher kinded types, where Java only supports one level of generics? Could be wrong

Ivan15:04:50

I am not an MS fan, but the F# I've read looks nice 🙂

borkdude15:04:06

Yeah, I never really understood why it didn’t take off

mpenet15:04:17

Lack of functors/polymorphic variants and presence of null comes to mind

mpenet15:04:49

Having access to the clr ecosystem is nice tho

borkdude16:04:12

Lack of functors is due to the lack of HKT in F#?

ddellacosta16:04:22

are we talking about ML-style functors?

borkdude16:04:21

I thought he meant Haskell-like functors

borkdude16:04:33

as in structure that can be mapped over

mpenet16:04:59

Yes I meant ml functors

mpenet16:04:51

Dunno why they didnt take that from ocaml too

ddellacosta16:04:06

I’d have to assume that the .NET internals made it prohibitively difficult for some reason

fellshard16:04:18

F#'s adoption problem seemed to me to be partially an extended dearth of good tooling, and partially a lack of a 'killer use case'; they tout their type providers, but have a very difficult time selling their use cases.

mpenet16:04:09

OCaml on the other hand has a tiny ecosystem and very slow language evolution (with some quite important shortcomings)

mpenet16:04:31

Beautiful language otherwise

mpenet16:04:53

Tooling is also a mess, or at least used to be

dpsutton16:04:54

how good is F# tooling off windows and for how long? seems like another concern

mpenet16:04:26

I used to know some very enthusiastic f# people here, it seems they all moved on to other things these past few years

mpenet16:04:03

Like elixir for instance (personally not a fan of it)

dpsutton17:04:18

moved on from F# or from clojure?

Ivan17:04:49

I take as "from F#"

Ivan17:04:59

as in, they didn't stick to the language

tbaldridge17:04:07

F# has a bizarre restrictions as well.

tbaldridge17:04:28

It always seemed to have weird restrictions from OCaml, but without a rationale for why they existed

tbaldridge17:04:14

@dpsutton I think C# killed F#, the tooling was way better, and each new release brought more and more functional features into C#.

borkdude17:04:39

@tbaldridge Can you name a few examples? I only dabbled with F# as a hobbyist

tbaldridge17:04:41

C# 7 has destructuring, Python style tuples, pattern matching,

tbaldridge17:04:56

C#'s version of Clojure's defrecord is also in the works.

borkdude17:04:43

as in case classes like in Scala ?

tbaldridge17:04:35

Yeah, something like this:

class Point(int X, int Y);

var v = Point With(X = 42, Y = 33)

tbaldridge17:04:52

They default to having public immutable members

tbaldridge17:04:00

(syntax is probably wrong)

borkdude17:04:03

yeah, that’s the same as in Scala

borkdude17:04:17

they also have default equality, etc.

tbaldridge17:04:35

And since this is .NET they're also value types and IIRC are passed around on the stack 😄

fellshard17:04:33

C# has a history of cannibalizing MS' other research projects - not necessarily a bad thing, but the research doesn't always end up seeing the light of day intact, either.

borkdude17:04:33

ah ok, that’s different from Scala then, although Scala has value classes but those can only wrap a primitive I believe

dpsutton17:04:58

We had reimplement those immutable records for some state that got passed around a bunch. Would have loved that

borkdude17:04:24

it’s the most pleasant feature of Scala imho