other-languages

here be heresies and things we have to use for work
borkdude 2018-04-17T15:00:37.000753Z

> 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

dpsutton 2018-04-17T15:02:15.000267Z

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

sveri 2018-04-17T15:02:50.000249Z

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

dpsutton 2018-04-17T15:03:12.000289Z

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

dpsutton 2018-04-17T15:03:27.000221Z

(never used it)

borkdude 2018-04-17T15:03:27.000664Z

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

dpsutton 2018-04-17T15:03:49.000903Z

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

borkdude 2018-04-17T15:04:11.000906Z

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

2👍
sveri 2018-04-17T15:04:36.000832Z

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

sveri 2018-04-17T15:05:04.000445Z

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

borkdude 2018-04-17T15:05:52.000904Z

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

sveri 2018-04-17T15:07:20.000476Z

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".

borkdude 2018-04-17T15:08:05.000817Z

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

sveri 2018-04-17T15:08:31.000673Z

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

borkdude 2018-04-17T15:08:52.000585Z

you can also use dynamic typing for that 😛

borkdude 2018-04-17T15:10:21.000414Z

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

Ivan 2018-04-17T15:15:50.000120Z

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

borkdude 2018-04-17T15:16:06.000798Z

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

mpenet 2018-04-17T15:45:17.000545Z

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

mpenet 2018-04-17T15:45:49.000779Z

Having access to the clr ecosystem is nice tho

borkdude 2018-04-17T16:01:12.000618Z

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

2018-04-17T16:10:22.000132Z

are we talking about ML-style functors?

borkdude 2018-04-17T16:12:21.000646Z

I thought he meant Haskell-like functors

borkdude 2018-04-17T16:12:33.000170Z

as in structure that can be mapped over

mpenet 2018-04-17T16:23:59.000277Z

Yes I meant ml functors

mpenet 2018-04-17T16:24:51.000339Z

Dunno why they didnt take that from ocaml too

2018-04-17T16:31:06.000117Z

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

fellshard 2018-04-17T16:43:18.000590Z

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.

mpenet 2018-04-17T16:47:09.000105Z

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

mpenet 2018-04-17T16:47:31.000636Z

Beautiful language otherwise

mpenet 2018-04-17T16:48:53.000163Z

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

dpsutton 2018-04-17T16:50:54.000606Z

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

mpenet 2018-04-17T16:58:26.000404Z

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

mpenet 2018-04-17T16:59:03.000343Z

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

dpsutton 2018-04-17T17:04:18.000443Z

moved on from F# or from clojure?

Ivan 2018-04-17T17:17:49.000440Z

I take as "from F#"

Ivan 2018-04-17T17:17:59.000353Z

as in, they didn't stick to the language

2018-04-17T17:23:07.000661Z

F# has a bizarre restrictions as well.

2018-04-17T17:23:28.000589Z

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

2018-04-17T17:25:14.000539Z

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

borkdude 2018-04-17T17:25:39.000397Z

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

2018-04-17T17:27:41.000147Z

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

2018-04-17T17:27:56.000489Z

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

borkdude 2018-04-17T17:28:43.000684Z

as in case classes like in Scala ?

2018-04-17T17:29:35.000231Z

Yeah, something like this:

class Point(int X, int Y);

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

2018-04-17T17:29:52.000360Z

They default to having public immutable members

2018-04-17T17:30:00.000104Z

(syntax is probably wrong)

borkdude 2018-04-17T17:30:03.000278Z

yeah, that’s the same as in Scala

borkdude 2018-04-17T17:30:17.000020Z

they also have default equality, etc.

2018-04-17T17:30:22.000558Z

exactly

2018-04-17T17:30:35.000826Z

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

fellshard 2018-04-17T17:31:33.000512Z

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.

borkdude 2018-04-17T17:32:33.000221Z

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

dpsutton 2018-04-17T17:33:58.000109Z

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

borkdude 2018-04-17T17:34:24.000157Z

it’s the most pleasant feature of Scala imho