CoffeeScript vs Hack: What are the differences?
CoffeeScript and Hack belong to "Languages" category of the tech stack.
"Easy to read" is the top reason why over 197 developers like CoffeeScript, while over 5 developers mention "Interoperates seamlessly with php" as the leading cause for choosing Hack.
CoffeeScript is an open source tool with 15.2K GitHub stars and 1.99K GitHub forks. Here's a link to CoffeeScript's open source repository on GitHub.
Code School, Zaarly, and thoughtbot are some of the popular companies that use CoffeeScript, whereas Hack is used by Facebook, Slack, and Wizters. CoffeeScript has a broader approval, being mentioned in 364 company stacks & 170 developers stacks; compared to Hack, which is listed in 8 company stacks and 3 developer stacks.
What is CoffeeScript?
What is Hack?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to add, upvote and see more prosMake informed product decisions
What are the cons of using Hack?
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions
Throughout 2016, Slack began migrating from PHP5 to Hack. They cite several well-known challenges inherent to PHP, including surprise type conversions, inconsistency around reference semantics, inconsistencies in the standard library, and the fact that “PHP tries very, very hard to keep the request running, even if it has done something deeply strange.”
To overcome these challenges while maintaining the unique values of PHP, Slack turned to Hack, a gradual typing system for PHP. Hack runs on the HipHop Virtual Machine, or HHVM, an open source just-in-time (JIT) environment for PHP.
Choosing to add TypeScript has given us one more layer to rely on to help enforce code quality, good standards, and best practices within our engineering organization. One of the biggest benefits for us as an engineering team has been how well our IDEs and editors (e.g., Visual Studio Code ) integrate with and understand TypeScript . This allows developers to catch many more errors at development time instead of relying on run time. The end result is safer (from a type perspective) code and a more efficient coding experience that helps to catch and remove errors with less developer effort.
Since the beginning, Cal Henderson has been the CTO of Slack. Earlier this year, he commented on a Quora question summarizing their current stack.Apps
- Desktop: And Electron to ship it as a desktop application.
- Android: a mix of Java and Kotlin.
- iOS: written in a mix of Objective C and Swift.
- The core application and the API written in PHP/Hack that runs on HHVM.
- The data is stored in MySQL using Vitess.
- Caching is done using Memcached and MCRouter.
- The search service takes help from SolrCloud, with various Java services.
- The messaging system uses WebSockets with many services in Java and Go.
- Load balancing is done using HAproxy with Consul for configuration.
- Most services talk to each other over gRPC,
- Some Thrift and JSON-over-HTTP
- Voice and video calling service was built in Elixir.
- Built using open source tools including Presto, Spark, Airflow, Hadoop and Kafka.
We have added very little to the CoffeeScript Hubot application – just enough to allow it to talk to our Hubot workers. The Hubot workers implement our operational management functionality and expose it to Hubot so we can get chat integration for free. We’ve also tailored the authentication and authorization code of Hubot to meet the needs of roles within our team.
For larger tasks, we’ve got an internal #CLI written in Go that talks to the same #API as Hubot, giving access to the same functionality we have in Slack, with the addition of scripting, piping, and all of our favorite #Unix tools. When the Hubot worker recognizes the CLI is in use, it logs the commands to Slack to maintain visibility of operational changes.
All front-end / back-end is driven by Coffeescript. For the main ReactJS functionality JSX is embedded with coffee in .cjsx files / handled by Browserify.
We like CoffeeScript because it's more readable, we use it because we have a lot of libraries and functions already (plays nicely with Rails, too)