other-languages

here be heresies and things we have to use for work
borkdude 2016-05-06T12:18:03.000008Z

Opinions on Scala?

borkdude 2016-05-06T12:18:45.000009Z

and Haskell?

tjg 2016-05-06T12:58:55.000011Z

@borkdude: Quite interesting discussion here: http://discuss.purelyfunctional.tv/t/types-clojure-and-pain/585

borkdude 2016-05-06T13:04:18.000013Z

Interesting thread, thanks

Jon 2016-05-06T13:11:56.000015Z

@bvulpes: well, I use whitespace more crazy than you think, here's my code editor

borkdude 2016-05-06T15:07:40.000025Z

(hmm, I should probably change language settings in Powerpoint)

tjg 2016-05-06T15:24:15.000026Z

@borkdude: What's the link to that? Closest thing I've found is a handwritten version without Scala/Clojure: https://channel9.msdn.com/Blogs/Charles/Simon-Peyton-Jones-Towards-a-Programming-Language-Nirvana

borkdude 2016-05-06T15:24:31.000028Z

https://www.youtube.com/watch?v=iSmkqocn0oQ

2016-05-06T16:42:02.000031Z

borkdude: and where praytell is Ada on that chart?

borkdude 2016-05-06T16:43:49.000033Z

@bvulpes: you decide

2016-05-06T16:45:27.000035Z

i'd squeeze clojure and scala significantly to the left, and scala significantly down on the usefulness spectrum

borkdude 2016-05-06T16:46:18.000036Z

@bvulpes: Interesting, your opinion is that Scala is more useless than Clojure?

borkdude 2016-05-06T16:46:28.000037Z

Please elaborate

2016-05-06T16:46:36.000038Z

i've seen a lot of time wasted trying to pave over paradigmatic incompatibilities between scala libs and even differences between author styles /within an org/

borkdude 2016-05-06T16:47:06.000039Z

@bvulpes: Have you used Scala professionally and for how long?

2016-05-06T16:47:09.000040Z

ofc "clearly they're doing it wrong", but otoh, "no true scotsman"

2016-05-06T16:47:39.000041Z

no, watched a scala org evolve through a friend who ultimately left in disgust at how the language had crippled their work.

borkdude 2016-05-06T16:48:03.000042Z

oh wow

2016-05-06T16:48:35.000043Z

yeah i mean it gives me hives, i won't touch it. but he liked the team, and so there went three years of his life.

2016-05-06T16:49:56.000044Z

and re clojure's "usefulness" well the compiler is not particularly useful in a wide swath of applications i'd like it to be.

borkdude 2016-05-06T16:50:13.000045Z

I'm using it at work now (also moved there because I liked the team/company). So far I must say that despite that bad noise, I quite enjoy it

borkdude 2016-05-06T16:52:05.000048Z

We use microservices, maybe that helps to prevent growing an unmaintainable mess

borkdude 2016-05-06T16:52:19.000049Z

of course that's not a silver bullet either

borkdude 2016-05-06T16:52:48.000050Z

I'd like to hear experiences from bigger Clojure teams vs bigger typed FP teams

borkdude 2016-05-06T16:55:53.000052Z

The real question is, is it types that make scaling easier, or mainly other things like immutability, people in the team, documentation etc.

2016-05-06T16:56:56.000053Z

over my pay grade.

2016-05-06T16:58:18.000055Z

i generally solve medium-sized problems for small orgs on my own. last mega codebase i was in was ios and let me tell you the challenges on that project were of the human factor drop-shadow "like this other interface but different in inane and complexity-inducing ways" kind.

seancorfield 2016-05-06T17:40:55.000057Z

I’m glad @martintrojer is here — hopefully we can ask questions about your articles?

seancorfield 2016-05-06T17:42:18.000058Z

We have 30K+ production lines of Clojure and 10K+ lines of test code. We aren’t really seeing the problems cited in that Prelude article — but we do have only a small team (two full-time Clojure devs, we had a part-time third dev for a while).

1👍
seancorfield 2016-05-06T17:43:05.000059Z

We certainly don’t find the nil-punning to be as problematic as it seems some people do.

seancorfield 2016-05-06T17:44:36.000060Z

We do find we have a lot of questions around best practices for actually organizing and structuring code across namespaces — and we’re constantly refactoring and refining that organization as we learn lessons over time.

borkdude 2016-05-06T18:06:42.000062Z

@seancorfield: do you use Schema and pre/post a lot?

borkdude 2016-05-06T18:13:34.000063Z

I think one of the important things is to have a team that is fluent with one technology and also knows how to deal with the downsides of it, regardless the language.

seancorfield 2016-05-06T18:14:56.000065Z

We’ve tried core.typed and Schema multiple times. We did not feel the benefits were worth the costs.

seancorfield 2016-05-06T18:16:13.000066Z

Schema’s validation is only as good as your test suite so it’s only going to catch errors in structure that don’t cause your underlying code to fail the test anyway.

seancorfield 2016-05-06T18:16:36.000067Z

core.typed is better in that regard: it checks the types not the (runtime) structures.

seancorfield 2016-05-06T18:17:34.000068Z

But retroactively adding core.typed to a large codebase is an exercise in frustration due to the relatively poor type inference it does and the fact that even for a single namespace, it’s essentially an all-or-nothing affair due to the amount of "warning" noise that a partially annotated namespace provides.

seancorfield 2016-05-06T18:18:51.000069Z

I think we’d gotten around 5% coverage with core.typed before we gave up. It required too many changes to code to satisfy its analysis, or else you just slapped metadata everywhere saying "Trust me — don’t check this body!" which sort of defeats the whole purpose.

seancorfield 2016-05-06T18:19:32.000070Z

We actually started with core.typed, switched to Schema, gave up, tried core.typed again, tried Schema again, then switched back to core.typed. Then gave up again.

seancorfield 2016-05-06T18:22:58.000071Z

Re: Scala — We came to Clojure from Scala. Lots of reasons. Scala 2.7 -> 2.8 was such a painful transition we were very gunshy about future upgrades. Compiler was very slow. Toolchain was fragile and quirky. Error messages were horrible, esp. when you ran into the combined buzzsaw of implicits and builtFrom (or whatever that weird collections library signature thing was).

seancorfield 2016-05-06T18:23:44.000072Z

We had a legacy dynlang system anyway so integrating Scala was painful on many levels (calling into Scala from other JVM languages gets messy unless you’re very careful about your API).

martintrojer 2016-05-06T18:50:59.000073Z

@seancorfield: nice to hear it's working out for you :)

martintrojer 2016-05-06T18:53:57.000074Z

My experience based on many things

martintrojer 2016-05-06T18:54:11.000075Z

Having to read code to figure to argument types is pretty horrible

martintrojer 2016-05-06T18:54:45.000076Z

All the NPEs is death by a thousand cuts

martintrojer 2016-05-06T18:55:17.000077Z

But the biggest thing for me is that I'm at lest 10x faster refactoring is a Lang like Haskell

martintrojer 2016-05-06T18:55:35.000078Z

With confidence as well, that haven't messed something up

martintrojer 2016-05-06T18:56:38.000079Z

Tracking side effects in types is also a pretty big thing for code quality

martintrojer 2016-05-06T18:57:05.000080Z

Biggest teams I've been in is 8 clj devs

martintrojer 2016-05-06T18:57:27.000081Z

Total code weighing in at 40k perhaps split over many services

martintrojer 2016-05-06T18:58:19.000082Z

Steady stream of totally unnecessary bugs pushed to prod

martintrojer 2016-05-06T18:58:35.000083Z

Anyway, on a journey to find something better

martintrojer 2016-05-06T18:59:11.000084Z

Front end is pretty clear, Elm has win written all over it

martintrojer 2016-05-06T18:59:19.000085Z

Backend still looking

seancorfield 2016-05-06T19:05:25.000087Z

I agree Elm is a great choice for the front end at some point. Not sure it’s really production ready yet beyond bleeding edge adopters (I followed Elm very closely for a long time during its development — and seeing ElmConf ahead of Strange Loop makes me want to attend that more than Clojure/conj this year).

seancorfield 2016-05-06T19:07:07.000088Z

I have a love/hate relationship with Haskell. I was part of the UK university research crowd that created our own FP language in the early 80’s as part of our language research. When Haskell appeared, I truly hoped FP would go mainstream — it was so obviously better than the status quo! — but Haskell remained an academic curiosity and OOP took over everything (unfortunately).

seancorfield 2016-05-06T19:08:36.000089Z

So I’ve worked with Haskell-like languages since the early 80’s and with Haskell itself on and off for about 25 years… and, much as I love many things about Haskell, every time I actually use it to try to build a real "thing" I get so incredibly frustrated with its whole ecosystem and, often, by the attitudes of many Haskellers 😿

seancorfield 2016-05-06T19:09:40.000090Z

As for Clojure’s NPEs… I just don’t encounter them much. I know some people run into them a lot. I don’t know why some do and others don’t.

borkdude 2016-05-06T19:09:43.000091Z

@seancorfield: one of the best thing of Clojure is the community, the people are so nice compared to other more elitist languages (my words)

borkdude 2016-05-06T19:10:41.000092Z

@seancorfield: on the other hand, I'm jealous of the documentation and effort some other communities are putting in their artifacts

seancorfield 2016-05-06T19:11:19.000093Z

I can understand the refactoring argument. The type system means you can’t break things in so many ways that a dynlang would allow you to break things during refactoring. Although I don’t find refactoring in Clojure to be particularly problematic so it isn’t a pain point I feel strongly about.

seancorfield 2016-05-06T19:12:13.000094Z

@martintrojer: Remind me, what was your language background before Clojure? Much FP? Much dynlang, or mostly typed languages?

borkdude 2016-05-06T19:12:22.000095Z

With 3 months of Scala, I can say that in my experience refactoring is much easier than in Clojure (2.5 years commercial experience)

borkdude 2016-05-06T19:13:29.000096Z

Maybe some tools make it easier now (like clj-refactor), but often these tools are not mature and crash (CIDER, etc).

borkdude 2016-05-06T19:18:39.000098Z

Running lein check and lein test in the background helps

borkdude 2016-05-06T19:20:42.000099Z

I wonder if Cursive makes a big difference here, I don't have enough experience with that

sveri 2016-05-06T19:32:14.000101Z

Interesting discussion so far and I agree with a lot of the statements made here I tried haskell a few times and always gave up because of the tooling, emacs being a big part of it (dont want to start IDE flamewar here, I just dont like emacs). It seems like stack solves some of these problems, but, the last time I looked into it the emacs setup stated that it still had problems with stack (which may be figured out inbetween) Also I have a hard time figuring out parameters and shapes of maps in standard clojure. Although I found some peace in schema. But again, here I agree, a better type system, which is optional, would fit my needs more.

sveri 2016-05-06T19:32:38.000102Z

@borkdude: I never used cursive for refactorings in large codebases, but for my small ones it did not fail once

sveri 2016-05-06T19:33:07.000103Z

I refactor parameters and function names, but lately saw that it can also refactor keywords, I wonder how reliable that is

martintrojer 2016-05-06T19:41:49.000104Z

@seancorfield: before clj: c, c++, Python, c#, f#

borkdude 2016-05-06T19:42:27.000106Z

My favorite languages were Common Lisp, then F#, then Clojure and now I don't know anymore 😉

sveri 2016-05-06T19:43:03.000107Z

Anyone here looked into Rust? I went through the docs and like the idea about ensuring data safety through the type system

borkdude 2016-05-06T19:43:13.000108Z

I think theses 'favorites' were always in the context of what I could do with them at work. So I chose F# when I was doing .NET.

seancorfield 2016-05-06T19:44:15.000109Z

@sveri: I spent a fair bit of time playing with Rust last year. It’s very interesting. Not so much for the type system itself but for the borrow-tracker aspect.

seancorfield 2016-05-06T19:45:18.000110Z

If I were doing near-metal systems programming, I’d be very tempted by Rust. It’s what I had hoped Go might be. [I think Go is horrible having spent a fair bit of time playing with it the previous year!]

seancorfield 2016-05-06T19:46:03.000111Z

If F# ran on the JVM (and therefore could interop with all my legacy code), I’d probably be using that instead of Clojure. Depending on tooling etc.

sveri 2016-05-06T19:47:26.000112Z

@seancorfield: That was my feeling too regarding Rust. It seems like there is also a lot happening regarding game development with Rust, if anyone is into that

martintrojer 2016-05-06T20:04:17.000113Z

@seancorfield: coreClr port will open the door for f# properly

martintrojer 2016-05-06T20:04:44.000114Z

Very nearly there, and better than the JVM on pretty much every metric

martintrojer 2016-05-06T20:05:28.000115Z

So much less boxing in .net it puts JVM to shame

martintrojer 2016-05-06T20:05:40.000116Z

Also, startup not an issue

seancorfield 2016-05-06T20:06:29.000117Z

But still completely irrelevant to me if I can’t interop with my existing legacy codebase! 😸

seancorfield 2016-05-06T20:07:34.000118Z

@martintrojer: One thing I found very interesting about your Prelude article was how you were bored just working in Clojure day-in, day-out. I would assume that has also been the case in all the previous languages you’ve used?

seancorfield 2016-05-06T20:07:56.000119Z

(well, assuming perhaps you left some of them due to frustration, rather than boredom 😆 )

borkdude 2016-05-06T20:10:23.000120Z

What is CoreCLR?

borkdude 2016-05-06T20:12:09.000121Z

Common Lisp and Clojure had the biggest impact on my enthusiasm for programming, but yes, even Clojure can feel like work when you're doing it day in day out. It also depends on the system you're building. If you're making a CRUD app and every feature is more or less the same old stuff, it gets boring.

seancorfield 2016-05-06T20:14:57.000125Z

(and a year of playing with Clojure before that)

seancorfield 2016-05-06T20:15:41.000126Z

And I do a bunch of hobby / FOSS Clojure in my spare time too. And I help non-Clojure devs learn Clojure (I’m doing my best to convert the world, one developer at a time!).

seancorfield 2016-05-06T20:17:34.000127Z

I look at that monadic getPlayer’ function and I think of (some-> params :player get-player) or similar...

seancorfield 2016-05-06T20:19:48.000130Z

I hope we’ll be hiring at some point, maybe this year, but probably a junior dev… maybe someone who’s fairly new to Clojure but seems to "grok" FP in general...

sveri 2016-05-06T20:21:44.000133Z

I would also love to do some clojure as part of my job. But here it is hard to find one in my City... I have not heard of one clojure Job...

borkdude 2016-05-06T20:22:31.000134Z

I had a job with a couple of Clojure projects, but it was a software services company and every project was only a couple of months. I was missing working in a team and building up deeper knowledge of something.

borkdude 2016-05-06T20:26:31.000138Z

What is it called in English when a company builds software and also maintains it for other companies (as opposed to help the developer team at some other company started and then leaving)

ericnormand 2016-05-06T20:35:38.000142Z

sounds like a consultancy

borkdude 2016-05-06T20:36:43.000143Z

there are two types of consultancies then: one that builds all your software and maintains it, and the type that can help you accelerate your software team

borkdude 2016-05-06T20:39:33.000145Z

@ericnormand: I read the discussion on your board. You mentioned 'types are the future, but...'. I thought it was interesting. Why do you think types are the future, but still do mainly Clojure?

ericnormand 2016-05-06T20:42:37.000146Z

they're the future, not the present :simple_smile:

borkdude 2016-05-06T20:42:49.000147Z

haha :simple_smile:

ericnormand 2016-05-06T20:43:01.000148Z

Clojure still rocks, and has a ton of great design decisions

borkdude 2016-05-06T20:43:46.000149Z

true

ericnormand 2016-05-06T20:44:00.000150Z

and I do want to expand into other languages

borkdude 2016-05-06T20:44:49.000151Z

You mentioned some Haskell experience. Some Clojure devs seem to go into that direction.

ericnormand 2016-05-06T20:44:57.000152Z

yeah

ericnormand 2016-05-06T20:45:04.000153Z

seems really common when people get frustrated

ericnormand 2016-05-06T20:45:11.000154Z

Haskell is a great language, up there with Clojure.

ericnormand 2016-05-06T20:45:38.000155Z

Clojure has a huge advantage with the Java ecosystem

ericnormand 2016-05-06T20:46:54.000156Z

Haskell is good, but the rhetoric is tiring.

ericnormand 2016-05-06T20:47:06.000157Z

I wish there were more options of typed languages to compare.

ericnormand 2016-05-06T20:47:36.000158Z

at the moment, saying "I want good types" seems to mean "I want Haskell".

seancorfield 2016-05-06T20:48:50.000159Z

pssst! There’s a Leiningen plugin that lets you do mixed Clojure/Frege projects

borkdude 2016-05-06T20:49:04.000160Z

I think Rich Hickey once said in one of his talks: it's either this or all the way to Haskell

ericnormand 2016-05-06T20:49:36.000161Z

what does "this" refer to?

borkdude 2016-05-06T20:49:47.000162Z

@ericnormand: dynamic typing?

borkdude 2016-05-06T20:50:00.000163Z

@ericnormand: I should look it up, can't remember the exact phrase

borkdude 2016-05-06T20:50:19.000164Z

@ericnormand: maybe it was about 'the language of the system'

borkdude 2016-05-06T20:50:36.000165Z

@ericnormand: programming like you do with services, but in the small

ericnormand 2016-05-06T20:51:00.000166Z

the next language I design (in like 30 years at this rate :simple_smile: ) will explore types

seancorfield 2016-05-06T20:53:08.000167Z

Back when I was exploring FP language design and implementation (my unpublished PhD thesis in the early 80’s), I created a dynamic language based on the notation in W.H. Burge’s book and implemented it as a transpile to LispKit (that part was based on Peter Henderson’s book). But I used a Prolog program to analyze types across whole programs to verify behavior.

seancorfield 2016-05-06T20:53:31.000168Z

(so, yeah, I had a transpiler to Lisp(Kit) and a transpiler to Prolog for separate purposes)

ericnormand 2016-05-06T20:53:47.000169Z

coooool

seancorfield 2016-05-06T20:54:36.000170Z

Prolog could produce a sequence of all types that satisfied the program — and it was pretty easy to see when you had an illegal program because Prolog, bless its little cotton socks, would just act the two year old child and respond with No.

seancorfield 2016-05-06T20:55:25.000171Z

It was also nice that if your program was essentially "any -> any" then you’d done something wrong 😆

seancorfield 2016-05-06T20:56:40.000172Z

It was very interesting to hear Matthias Felleisen ragging on Hindley-Milner type inference at Clojure/West.

ericnormand 2016-05-06T21:00:02.000173Z

oh yeah?

ericnormand 2016-05-06T21:00:04.000174Z

what did he say?

seancorfield 2016-05-06T21:13:11.000175Z

Oh dude, you have to watch the talk! It’s awesome!

borkdude 2016-05-06T21:13:24.000176Z

yes, it was an awesome talk

seancorfield 2016-05-06T21:14:56.000178Z

An hour and fifteen — it stands out like a sore thumb by virtue of being half an hour longer than any other talk at the conference! 😆 No one wanted him to stop!

borkdude 2016-05-06T21:27:34.000179Z

"Everyone in Clojure thinks in types, but nobody is writing them down" was a sentence I remembered

sveri 2016-05-06T21:31:02.000180Z

Isnt that how you do it in every language that has insufficient types?

borkdude 2016-05-06T21:32:10.000181Z

Of course. But his story went on. At least you could write them down as documentation. But then it becomes a problem that they are not checked and the documentation isn't right anymore.

sveri 2016-05-06T21:32:45.000182Z

Just like it always is with documentation

borkdude 2016-05-06T21:33:19.000183Z

Right. So it would be nice if you could check it. And this is how he arrived at Typed Racket more or less, if I remember correctly.

sveri 2016-05-06T21:33:55.000184Z

Yes, I watched it too, no objections from my side, I just wanted to point out that this problem is not specific to clojure

borkdude 2016-05-06T21:35:01.000186Z

Agreed

tjg 2016-05-06T21:52:14.000188Z

I feel like a weirdo when mentioning my programming opinions (liking lisps doesn't help), but I avoid scaling problems by avoiding writing large programs.

tjg 2016-05-06T21:53:30.000189Z

I believe there's lots of techniques that help you do this. (After all, using a high-level language is one.)

tjg 2016-05-06T21:56:37.000190Z

Not just technically, but socially. Finding another programmer with whom you can synch well with imposing constraints on your mutual work... not so easy in my experience.

tjg 2016-05-06T22:05:30.000192Z

To the extent that large programs are necessary (for example, accepting Tim Daly can't simply avoid a large Axiom codebase, given its 1.5 million lines of Common Lisp), it's a new game, and static types are only one of many techniques available.

borkdude 2016-05-06T22:06:42.000193Z

@tjg What other techniques can we use in Clojure?

tjg 2016-05-06T22:07:59.000194Z

Guess I'll write about this in the http://discuss.functional.tv discussion, but Tim Daly frequently mentions literate programming. http://lambda-the-ultimate.org/node/3663#comment-51878

tjg 2016-05-06T22:09:09.000196Z

So for example, he edited a literate programing book of Clojure. http://daly.axiom-developer.org/clojure.pdf

borkdude 2016-05-06T22:10:07.000199Z

"Beyond a certain point of complexity you can only understand a program by talking to the author about why they wrote it the way they did." I think he's right about that, types or no types

borkdude 2016-05-06T22:10:34.000200Z

He proposes literate programming for software that must survive beyond 5 years

seancorfield 2016-05-06T22:14:01.000201Z

Are there really any large systems in production written using literate programming?

borkdude 2016-05-06T22:16:15.000202Z

And doesn't literate programming suffer from the same problem as other documentation, that it isn't checked and therefore is incorrect a lot of the time?

1👍
tjg 2016-05-06T22:45:58.000203Z

BTW, I don’t personally advocate literate programming, just one of many perspectives I’d consider if I ever entered the world of Large Clojure Programs. As I understand Martin Trojer’s article, a sufficiently large Clojure system requires you to spend “more than 50% of the total line count” on maintaining its architecture.

tjg 2016-05-06T22:46:02.000204Z

Analyses like that are one of the reasons I simply try to avoid large systems... like I avoid hard computational complexity classes. (For example, “Small Things, Loosely Joined, Written Fast, Discarded Readily.” http://blog.cognitect.com/blog/2016/3/17/the-new-normal-protected-asset-or-disposable-inventory )

tjg 2016-05-06T22:46:07.000206Z

I have no idea about literate programming, but I personally devote much time to documentation: - an org-mode notebook in git, where I try to boil a domain down to a conceptual language, and constantly describe project case-studies in terms of it. - “Battle Stories” (which I first developed in a company with 15 devs, using narrative structure so people read my boring tech notes) - video walkthroughs (timestamped), where developers walk me through their systems as I ask questions