I think overall it needs more development, in particular in regards to UX and integrating into a modern development workflow. I'm excited to see its progress :)
2,032 karma · joined April 1, 2013
http://github.com/adnelson
I think overall it needs more development, in particular in regards to UX and integrating into a modern development workflow. I'm excited to see its progress :)
I touched on this a bit, but the main thing is the compiler experience. I've written apps in Haskell compiled to JS before; specifically I was using Miso. While I very much enjoy writing Haskell -- that part was great -- the compiler is very slow, the binary is huge, and the generated code is completely incomprehensible. There are a few other disadvantages, such as runtime bulk, speed, laziness and the multitude of string types as well. Bucklescript is _so_ much faster than ghcjs and the tooling fits neatly into an established workflow (i.e. webpack, create-react-app etc). It compiles almost as fast as ES6, it has a built in code formatter, it supports JSX natively, etc.
That, plus I had been curious about trying OCaml for a while and I figured why not.
I think where ReasonML/OCaml wins hands-down is its compiler. Bucklescript (and I've heard similar things about other compilers, but can't vouch for it) is lightning quick, and the community has gone leaps and bounds to make it super easy to bootstrap (including with create-react-app). GHC can do amazing things but it's not the fastest out there, and the compiler for the JS backend is abysmally slow. The code Bucklescript produces is very high quality and performant. The library ecosystem is reasonably strong and I expect (but haven't done much testing) that because of the strictness and relative simplicity of the language, library code would tend to be pretty performant and easy to use. I've never found myself in OCaml wondering what string type I should use, or attempting to parse some absurdly complex type hierarchy in a library.
I think for a frontend project, to most programmers I would recommend ReasonML. For one thing, I think even most without experience with FP would find ReasonML to be a giant improvement over Flow (which infuriates me as a type checker), and it doesn't take a ton of time to learn. ReasonReact is a pretty sweet library and I prefer it to React even setting aside language choice. Compared to Haskell, its strictness means it doesn't require a special runtime, generate slow/impenetrable code, or hog tons of resources -- all things that are issues in frontend Haskell. For those who really want to use Haskell on the frontend I'd recommend PureScript instead (also you get the bonus of a kickass record system).
For backend, I think OCaml will get you up and running sooner, but in the long run you're going to find yourself missing the type system and language features Haskell has. GHC's speed on the backend is tolerable (especially if you use nix), and I think Haskell is competitive in performance to OCaml (perhaps better with optimization). Most importantly, I think Haskell is second to none when it comes to correct implementations of business types and logic, creating powerful and reliable abstractions, and eliminating boilerplate, and I think that forms a greater advantage in backend code.
EDIT: this turned into quite the essay...
https://www.google.com/maps/@41.9092286,-87.6725628,3a,34.8y...
All that being said, while having true perfect pitch would probably open up new ways to appreciate and understand the music I'm listening to, I think that relative pitch is a far more useful skill -- nigh essential for many genres.
On the other hand, Haskell’s system has more flexibility, offering a few powerful primitives which can be used as building blocks for higher level abstractions. On top of that it is a general purpose language capable of implementing traditional imperative patterns, etc, so you only need to use the concurrency when it makes sense, rather than using it for all stateful and IO operations as in Erlang/Elixir. Its performance ceiling is certainly higher. I don’t think monads in Haskell are a problem except in terms of the learning curve.
All in all, which one to use, if either, will depend on the circumstances. But both of them should be a part of any thorough discussion of languages which are “good at concurrency”. ;)
All that being said, I haven’t written Go and can’t compare the two. Also, Haskell doesn’t support the actor/message passing model out of the box (although libraries exist for it) or prevent deadlocks (although the immutability helps a great deal here). BEAM languages, clojure, rust, pony and others all have their strengths here — again, this doesn’t discredit the article at all but the idea that Go is the clear winner is debatable.
Not all job changes are so drastic. Refusing to implement this behavior might be as simple as just requesting to switch teams within Google. If one chooses to leave, finding another high paying job in the same area is not typically a great challenge for a Google engineer. No uprooting necessary...
This seems somewhat baseless. Unreadable according to whom? There are many large and complex programs written in Haskell by large teams of developers (open source or otherwise). It’s the nature of software in any language to become difficult to manage as the code base becomes large; I don’t think Haskell is an exceptional offender in this category.
> There is a reason everyone is not jumping into the functional programming bandwagon, despite mature languages being available for 30+ years.
There certainly are reasons for that, but not the ones you laid out.
Very true. However, I didn't claim that censorship should be the central point of the article. I simply noted that it was barely mentioned at all.
> Rarely have I seen someone go into a lengthy speech about government overreach or free speech.
I'm not really sure what this demonstrates -- this can hardly be surprising in a country which provides no way for ordinary citizens to participate in government, has no history of its citizens doing so, and actively discourages them attempting to. That being said, it's certainly believable that freedom is not high on the list of priorities for the average Chinese citizen, but again, I never said that it was.
> We should allow people to talk about the Chinese tech ecosystem without having to pay their due to Western audiences in the foreword.
Another refutation of a claim that I never made.
As to the rest of your post, I agree! I've spent some time in China and was really amazed at how connected it was and how much could be accomplished with just a phone. I was mostly in the cities, but I also went out to the countryside and for the most part everything just worked, and everyone had WeChatPay and AliPay :)
This is especially true when it seems to be simply ignoring elephants in the room, such as in the oblique references to security/privacy or copyright law, or claiming that talking about censorship is "unfashionable". For another example, the article spends a good deal of time talking about WeChat, one of several unicorn technology companies which, while certainly it's been very innovative in its history, likely only exists in large part due to the blockage of Facebook and Twitter.
This isn't knee-jerk sinophobia, this is pointing out some pretty obvious holes in the discussion here and speculating as to the reason for them. Of course, the overall tone of the article is rather fawning, but this is Hacker News so that's nothing out of the ordinary.
It never even mentions the Great Firewall (unless I missed it?) and only barely mentions the security and censorship issues involved in writing software in China, even claiming that the reason it’s difficult to talk about security and privacy is because “so much of the grand technological experiment in China is still unfolding.” Right; I’m sure that’s the main reason.
The article also breathlessly mentions that “there are still parts of the rural US without cell phone service, places where you feel untracked and like you might disappear. Yet even in one of the poorest provinces in China, QR codes will follow you from towns to villages.” Even if you assume that’s something that everyone wants, to ignore the implications of having that technology available in a highly invasive police state is irresponsible (in my opinion).
Finally, I thought the line that “its strength is in extreme open-source, which stands in stark contrast to the increasingly proprietary nature of American technology“ is completely laughable in a country as notoriously insecure as China and in an era when use of open source software is probably at an all-time high in the US.
(Edit: added newlines for clarity)
(Not that I’m claiming to know your code base or specific challenge or anything; I’m just speaking generally)
1. You know what the code is doing to the extent that you know how monads work. As in, you know that you’re going to do some monadic action that returns a, then another one that returns b, etc. The code as written is generic so it’s not specified what the actions are.
2. And this is the much more common case; the code in question is being used within a particular context (I.e. for a particular monad that the programmer is working with) and the context makes it obvious what is actually being done by the monadic actions. Here the genericness is not in writing a function that can be used in multiple places, but in having a portable concept of “a pipeline of actions that return things and could fail” which you can use wherever you need it.