other-languages

here be heresies and things we have to use for work
ghadi 2017-11-01T19:13:20.000117Z

if types aren't sufficient, have you tried adding more types?

ghadi 2017-11-01T19:13:34.000477Z

:simple_smile:

seancorfield 2017-11-01T19:15:42.000059Z

That Front Row article made my blood boil -- it gets the semantics of Clojure completely wrong so it's not any sort of "rewrite Clojure in Haskell". It's a ridiculous article.

2017-11-01T20:15:43.000391Z

And funny enough it's a perfect example of what both Rich and Eric were talking about:

2017-11-01T20:16:17.000320Z

1) it's a "fun" puzzle with little gained in the end

2017-11-01T20:16:51.000144Z

2) a whole lot of words to describe something that could be done, but no one has actually done it

2017-11-01T20:17:07.000363Z

And yeah, even then it misses out on runtime polymorphic extension so it's still wrong.

2017-11-01T20:17:37.000019Z

Because they built it all with pattern matching which is exactly what Rich pointed out as a flaw

roberto 2017-11-01T20:21:00.000020Z

It is not about the semantics of clojure, it is trying to show that you can also parse inputs that donโ€™t have a strictly defined schema.

2017-11-01T20:21:31.000257Z

eh, but you can't really

roberto 2017-11-01T20:21:39.000326Z

The author probably didnโ€™t communicate that clearly, I can see how the wrong message can be inferred from it.

2017-11-01T20:22:16.000301Z

What you get out is a dynamically typed structure, and then you have to somehow map that to internal static types. Which means you just build an informal, bug ridden, .... implementation of lisp, in Haskell ๐Ÿ˜›

2017-11-01T20:25:48.000180Z

Not to mention that that example doesn't really work either, since true EDN parsers must support data readers. So you have to handle extension at runtime, where something like #inst "2012-01-02" needs to be a physical date object (not a tagged or wrapped value). No way to type that at compile time. So you're left writing a dynamic type system for haskell.

seancorfield 2017-11-01T20:42:36.000056Z

It also ignores the transducer-returning arity of map -- which Haskellers have previously failed to write correct types for (I seem to recall Rich specifically calling out that transducers cannot be fully typed in Haskell?).

seancorfield 2017-11-01T20:44:46.000629Z

It basically ignores anything and everything that would show the (obvious) holes in his argument. Sorry, it's making me angry/frustrated again just re-reading it...

seancorfield 2017-11-01T20:45:23.000276Z

(and he doesn't even have a comment system so I can vent on his blog about how wrong he is! ๐Ÿ™‚ )

cfleming 2017-11-01T21:20:07.000058Z

You can vent in at least 4 places on reddit ๐Ÿ™‚

dpsutton 2017-11-01T21:27:06.000041Z

i'd also like to read a blog that makes some examples a little more concrete if you were interested in typing some thoughts up

2017-11-01T22:15:05.000221Z

@seancorfield is right, the thing that I haven't seen fully explored (or solved) in Haskell is that transducers create a sort of state-machine.

2017-11-01T22:15:28.000014Z

Imagine if you tried:

2017-11-01T22:16:39.000295Z

actually I don't even know how to type that. but you can imagine a reduce over a typed map. Where some keys are known to have integer values, but others are known to have string values.

2017-11-01T22:17:13.000085Z

A correctly typed transducer should be able to catch errors with that at compile time.

seancorfield 2017-11-01T22:19:00.000094Z

I try not to venture into Reddit. Too many "opinions" and it's a giant ol' time sink...

2017-11-01T22:35:13.000041Z

that rings hollow to me

2017-11-01T22:35:40.000463Z

function composition is very type-able, and that is what a transducer is

2017-11-01T22:36:48.000211Z

or I should say building a transducer is function composition, and a transducer is just a function from a step function to a step function, and those are also known to exist in typed languages