Fork me on GitHub
#off-topic
<
2015-11-24
>
borkdude10:11:02

yeah, because almost no-one is adopting Javascript, Python or PHP anymore

borkdude10:11:28

and you must be crazy to start a project in Ruby these days

borkdude10:11:38

let's not talk about R

jaen10:11:42

Well, you must be crazy to start a project in PHP, that's for sure.

borkdude10:11:59

@jaen: I do agree with that one simple_smile

jaen10:11:42

It's slightly better I think, but yeah, there are better choices for sure ; d

jaen10:11:56

I mean, that was about Javascript.

borkdude10:11:51

I wonder what Bodil's problem with Clojure is. Read through these tweets from the last year. https://twitter.com/search?q=clojure%20from%3Abodil&amp;src=typd&amp;lang=en

borkdude10:11:56

She even prefers JS over Clojure.

jaen10:11:31

I dunno, I don't like that person enough to care about what she has to say ; d

jaen10:11:31

But I imagine - types notwithstanding - Clojure as a language certainly feels less welcoming than, say, Elm does.

jaen10:11:58

And I see some complaints about license, but IANAL so I don't understand that part.

dm311:11:19

has anyone here switched from a proper statically typed language (haskell/ocaml) to Clojure? If so, why?

borkdude11:11:47

I've switched language from Common Lisp to C#, F#, back to Clojure

borkdude11:11:59

also others on the side of course: Java, Ruby

jaen11:11:14

Hm, why F# -> Clojure move if you care to elaborate?

borkdude11:11:27

@jaen: I like Lisp and a REPL

jaen11:11:56

Well, F# has REPL IIRC

maleghast11:11:58

That’s why I choose Clojure whenever I am empowered to choose simple_smile

jaen11:11:02

So is it lacking?

borkdude11:11:36

@jaen: it's different. It's not a session like in Lisp, but more like Haskell. If you want to redefine functions, you lose your state.

borkdude11:11:32

anyway, I still don't think there is one -best- language that beats them all.

borkdude11:11:56

but Clojure is a lot of fun

dm311:11:27

is F# less fun? guess the community is also a factor

jaen11:11:53

Well, F# is .NET, which has a more commercial slant than JVM community, I think

borkdude11:11:18

@dm3: To be fair, my time with F# was fairly limited. I don't know the community well. It seems to have grown in the last few years, with amazing looking tools like Websharper, which I have never used.

jaen11:11:53

Yeah, Websharper looks amazing, I like how they ended up open-sourcing it

borkdude11:11:55

F# was definitely more fun than C# though. One factor was the REPL. I could build a UI incrementally, etc.

borkdude11:11:13

Still, C# isn't a bad language either. More fun than Java.

jaen11:11:44

C# had the nice thing that is hindsight

jaen11:11:05

So they have things like reified generics or TCO in the VM, the language is actually pleasant to use and so on

borkdude11:11:48

I guess it all depends where you're coming from. When Java came out, compared to C++ it was cool I guess.

borkdude11:11:05

we're all just spoiled programmers, standing on the shoulders of genius people we often don't know 😉

jaen11:11:25

It's funny how sometimes things languish before being rediscovered and touted as new shiny things

jaen11:11:45

Like Java was awesome because of virtual machines and garbage collections

jaen11:11:53

And it was all in LISP ages ago

borkdude11:11:26

@jaen: did LISP also have platform independence?

jaen11:11:28

I wouldn't know, didn't live back then, but it's quite possible it was not as big back then, with no multiple, well-established operating systems.

jaen11:11:39

I'm not saying Java didn't add anything new at all

jaen11:11:28

It's just interesting how some ideas in IT come back in a Ouroborous-like cycle.

jaen11:11:06

@dm3: as for me - I didn't exactly come to Clojure from knowing Haskell like the back of my hand, but my introduction to FP was statically typed languages - Haskell, ML and such. But why I'm writing in Clojure instead of Haskell - even though I prefer static typing - is quite simple. Clojure has much gentler learning curve than Haskell. With Haskell I feel like I have to invest two years of effort to study monadology in order to write a real application and not just implement some algorithm, and with Clojure it feels considerably simpler to be able to write a real application.

borkdude11:11:54

@jaen: why didn't you pick Scala?

jaen11:11:14

@borkdude: to me it feels too much like C++ in that it is an accretion of features, that introduces accidental complexity into the language itself. I like to compare it to Wesley's house from Harry Potter, where it basically looks like a tower of houses built atop of houses when the space in the first one ran out. It's just too complex for it's own good, probably more complex than Haskell even.

jaen11:11:24

There's a talk by Simon Peyton Jones on type system

jaen11:11:13

Where towards the end of the first lecture he broaches the topic of how combining Hindley-Milner typing (FP) with subtyping (OO) is a hard task that introduces a lot of complexity, even from theoretical point of view, due to things like for eg. variance.

jaen11:11:38

And Scala is trying to do exactly that, so it will never be able to run away from some of the complexity.

jaen11:11:34

That, and I actively despise Java. So if I had a choice between Haskell and Scala, then non-JVM thing would win. Clojure doesn't have as significant competition (Dylan? Chicken? Racket? SBCL? Racket is maybe the closest, but it's still a niche language and perceived as an educational one) so I kind of started using Clojure in spite of it being JVM-based.

agile_geek11:11:08

@jaen: I think you’ve just summed up my concerns about Scala!

jaen11:11:45

Heh. I just can't trust language that relies on culture to do the right thing. C++ is a great language for writing high-performance code, iff programmers know what they are doing, read all those Effective C++'s, use unique_ptrs and so on. And Scala is probably also a great language if you know it's ins and outs well, but if you don't then there's probably a disaster waiting to happen.

jaen11:11:11

Haskell it's a bit different here in that if you don't know it enough the disaster won't happen, but that's because you don't know it enough to write something useful. And I'm not sure if that's strictly better than Scala's or C++'s case - yeah you won't blow anything up, but you won't get anything done either.

jaen11:11:20

Yeah, if you already invested the time to learn it, it's probably the best language this side of Idris, but most of people just don't have the time to spare to invest into that.

jaen11:11:50

And I just decided to have dynamic typing pains from time to time in order to start being productive sooner than two years in P ;

agile_geek11:11:44

I agree although I think it’s not just culture but ‘knowledge’. People can have the right cultural perspective but haven’t got the experience to recognise the right thing to do. For example, I would fail for this reason if I used Scala as I don’t have the experience and knowledge of patterns and anti-patterns

jaen11:11:38

Yeah, you are right, I kind of implicitly conflated those two.

agile_geek11:11:58

I do worry that dynamic typing leaves that kind of ‘hole’ in Clojure

jaen11:11:37

Hmm, while certainly whether the language has static types or not influences the degree to which you need to rely on culture, I think simplicity of the language is also an important factor. And Clojure strives to be as simple as possible, which somewhat mitigates the fast & loose aspect of dynamicity. I think so far it seems to be working out rather well.

jaen11:11:38

Though I've seen libraries that I couldn't make head or tails of, like friend for example. So I guess we can just wait and see where the balance strikes in the long run.

dm312:11:59

good discussion simple_smile this confirms my theory of the programmer's toolkit being expanded, from entry level (java/c#/ruby/python/javascript) -> better concurrency story/more sophisticated type system (elixir, erlang, clojure, typescript, java-scala) -> correctness/paradigm shift to focus on types rather than values (f#/ocaml/haskell/haskell-scala)

dm312:11:19

left outside the "performance" group of c/c++/rust

jaen12:11:44

Well, if you compare C++ and Rust it also seems to want to integrate more correctness into systems programming.

sveri12:11:18

Just to add my two cents. I love clojure for my personal stuff, which is not that much. However, whenever I come back to something, even after just a few hours or days, I struggle with exactly what that blog post described, not knowing exactly how my params look like, what they contain or not. Itried core.typed and also was not able to express everything I wanted, it has a steep learning curve I think. Prismatics schema is something I tried a few times but was some kind of unsatisfying. I think about this often. What I need is not a sophisticated type system (although I like the advantages it brings). But just some description that reminds me of what my arguments are, right now, here, when I need it and which arguments another function expects. From my POV this is the biggest weakness of clj / cljs and something that stops me from coding from time to time.

sveri12:11:11

Something like a tooltip for a function would be nice declaring exactly what kind of map it expects. Similar to core.typed, but less error prone and less intrusive. Reading all that stuff in my code also somehow destroys the simplicity shortness of clojure functions.

jaen12:11:22

Wouldn't schema.core/defn work for that? You can then define function like so (defn function :- ReturnSchema [argument :- ArgumentSchema] ...) and some editor support to display those schemas in tooltips.

jaen12:11:28

Or is that not enough?

sveri13:11:39

@jaen: Thats exactly what I tried in my last coding sessions. I cannot really name what disturbs me there. It sounds like what I want. But 1. there is that big pile of declaration. Either it is in the file where I use it most and clutters my code or it is in a different namespace and I constantly have to switch

sveri13:11:48

2. Giving it a name often is not sufficient enough and I need to lookup the declaration, somehow breaking my flow

jaen13:11:37

Sure, that's why I mentioned some editor support. I imagine if Cursive added some support to display those schemas inline for schema.core/defn it would probably help considerably.

jaen13:11:03

And any nominal type system has this flaw.

sveri13:11:11

jaen: I agree, that would be nice...

dm313:11:48

actually, schema.core/defn embeds the schema declaration into docstring

dm313:11:10

I believe cursive/emacs display the docstring now

jaen13:11:53

Hmm, when I try ctrl+Q it doesn't seem to be embedded.

sveri13:11:14

I see the doc string, but did not try it with prismatics schema. I will try that though, thank you.

dm313:11:02

repl=> (schema.core/defn hi :- Number [x :- String])
nil
repl=> (meta #'hi)
{:arglists ([x]),
 :column 1,
 :doc "Inputs: [x :- String]\n  Returns: Number",
 :line 1,
 :name hi,
 :raw-arglists ([x :- String]),
 :schema #schema.core.FnSchema
 {:input-schemas ([#schema.core.One
                   {:name x,
                    :optional? false,
                    :schema #<Class[email protected] java.lang.String>}]),
  :output-schema #<[email protected] java.lang.Number>},
 :tag #<[email protected] java.lang.Number>}
seems to work here

jaen13:11:12

Hmm, so the data is there, just some way to expose it would be needed.

sveri13:11:56

If I declared a schema and gave it a name, would it expand on that in the doc string? From CoolType to {:require-key ....}

jaen13:11:24

For me it doesn't when I do ctrl+Q in Cursive

jaen13:11:31

I get just the nominal type.

dm313:11:48

don't think it would expand - where would you stop? simple_smile

sveri13:11:26

Good question...when I know what I need to know 😉

jaen13:11:27

Tooltips could then have some + icon to expand when needed, I guess.

sveri13:11:39

Another problem I see is that there is core.typed, being part of clojure core and prismatic schema on the other side. As a library maintainer do I have to support both? Only one? Do we need conversion? Do we need it at all? Being split on that makes things harder for everyone I think.

jaen13:11:39

That's certainly true, though you only have to support core.typed if you want to. As far as I understand that schemas are more for the programmer-producer than for programmer-consumer. You use it to check contracts internally and not expose it. But the question whether or not to support core.typed in your library is certainly a valid one - not everyone uses it, but some will appreciate that.

dm313:11:45

I think core.typed will not get much adoption unless another couple of man-years are put into it. It really slows down the development compared to schema

mpenet18:11:12

It s a bit apple vs orange

mpenet18:11:42

One does static type checks the other runtime checks.

mpenet18:11:20

In theory core typed could be much nicer, but it has a long way to go. Would be interesting to have some integration between both.

johanatan20:11:48

@danielstockton: I've been trying to get someone to take interest in installing the slack <-> IRC bridge but everytime I've mentioned it, it has fallen completely on deaf ears (i.e., gotten zero replies): https://ekmartin.com/2015/slack-irc/

kirked21:11:56

@borkdude I think you'll need to use a more sophisticated PDF tool that supports font selection and subsetting. The character info is here (http://www.fileformat.info/info/unicode/char/1f60b/index.htm), but without proper font support it'll always look wrong.

kirked21:11:32

On my Mac, the browser chooses "Apple Color Emoji" font for that, but I see that the DejaVu Sans family supports those in black & white.

cfleming21:11:35

@jaen: Issue welcome for the schema thing, it’s something I thought about but haven’t done yet.

christianromney21:11:38

the man to ask about PDFs is Chas Emerick simple_smile