Software Alternatives, Accelerators & Startups

GHCJS VS ClojureScript

Compare GHCJS VS ClojureScript and see what are their differences

GHCJS logo GHCJS

Haskell to JavaScript compiler, based on GHC. Contribute to ghcjs/ghcjs development by creating an account on GitHub.

ClojureScript logo ClojureScript

A Clojure compiler targeting JavaScript
  • GHCJS Landing page
    Landing page //
    2023-10-10
  • ClojureScript Landing page
    Landing page //
    2023-05-06

GHCJS features and specs

  • Haskell to JavaScript Compilation
    GHCJS allows developers to compile Haskell code to JavaScript, enabling the use of Haskell’s advanced type system and functional programming features in web development.
  • Code Reusability
    Developers can reuse their Haskell codebase for both server-side and client-side applications, reducing code duplication and maintenance efforts.
  • Strong Type System
    Haskell’s strong static type system helps in catching errors at compile time, which can result in more robust and reliable code for web applications.
  • Interoperability
    GHCJS provides interoperability with existing JavaScript libraries and modules, allowing developers to integrate Haskell into existing JavaScript ecosystems smoothly.

Possible disadvantages of GHCJS

  • Performance Overhead
    Generated JavaScript code may have performance overhead compared to native JavaScript, which can affect the execution speed of web applications.
  • Tooling and Ecosystem
    The GHCJS ecosystem and tooling may not be as mature or extensive as more established JavaScript frameworks, potentially leading to challenges in debugging and developer support.
  • Compilation Complexity
    The compilation process from Haskell to JavaScript can be complex, and build times might be longer compared to traditional JavaScript projects.
  • Limited Community and Support
    The GHCJS community is relatively smaller compared to mainstream JavaScript communities, which might limit the availability of resources, tutorials, and third-party libraries.

ClojureScript features and specs

  • Immutable Data Structures
    ClojureScript provides persistent, immutable data structures which simplify reasoning about code and avoiding unintended side effects.
  • Functional Programming
    ClojureScript is a Lisp that encourages functional programming, aiding the creation of concise and predictable code.
  • Interoperability with JavaScript
    ClojureScript can interoperate seamlessly with JavaScript, allowing access to JavaScript libraries and facilitating interaction with existing JavaScript codebases.
  • REPL Driven Development
    The REPL (Read-Eval-Print Loop) in ClojureScript enables rapid testing and iteration of code, resulting in more efficient development processes.
  • Rich Ecosystem
    ClojureScript benefits from the rich ecosystem of Clojure libraries and tools, as well as those available in the JavaScript ecosystem.

Possible disadvantages of ClojureScript

  • Learning Curve
    ClojureScript has a steep learning curve for developers new to Lisp or functional programming paradigms, which may limit its initial adoption.
  • Compilation Overhead
    Unlike JavaScript, ClojureScript code needs to be compiled, which can add complexity and overhead to the development workflow.
  • Smaller Community
    ClojureScript has a smaller community compared to more mainstream JavaScript frameworks, which can affect the availability of resources and support.
  • Tooling Complexity
    Integrating ClojureScript into existing projects can be complex, and its tooling setup might not be as straightforward as more established JavaScript tools.
  • Performance
    While generally performant, ClojureScript applications can sometimes face performance penalties due to the abstraction layers involved.

GHCJS videos

No GHCJS videos yet. You could help us improve this page by suggesting one.

Add video

ClojureScript videos

How to use NPM Packages in ClojureScript

More videos:

  • Review - ClojureScript - Chris Houser
  • Review - ClojureScript Release - Rich Hickey

Category Popularity

0-100% (relative to GHCJS and ClojureScript)
Personal Finance
40 40%
60% 60
Financial Planner
48 48%
52% 52
Finance
100 100%
0% 0
Cryptocurrencies
0 0%
100% 100

User comments

Share your experience with using GHCJS and ClojureScript. For example, how are they different and which one is better?
Log in or Post with

Social recommendations and mentions

Based on our record, ClojureScript should be more popular than GHCJS. It has been mentiond 17 times since March 2021. We are tracking product recommendations and mentions on various public social media platforms and blogs. They can help you identify which product is more popular and what people think of it.

GHCJS mentions (4)

  • Secretly introduced rust in my company, now they love it!
    There is a fork that compiles to js https://github.com/ghcjs/ghcjs compiler, and I believe the official glasgow compiler is working towards also supporting js/wasm (although I don't think they are supported as of yet). Source: about 2 years ago
  • Is GHCJS stuck on GHC 8.6.5?
    Default branch on ghcjs github is 8.6. 8.10 is a wip with commit from around a month ago. Source: about 4 years ago
  • Why Do We Need Transpilation into JavaScript?
    At present, here at Typeable we develop frontend in Haskell and use the web framework Reflex and the functional reactive programming (FRP). The source code in Haskell is transpiled into the JavaScript code using GHCJS. - Source: dev.to / about 4 years ago
  • Why supporting all programming languages is a bad idea
    In theory it is possible to write applications that run in the web browser in Java or C# or C++. There are compilers to compile Java to JavaScript or C++ to JavaScript/WebAssembly and a C# runtime that runs in the browser. In practice these technologies are very niche and only used for very few applications. The Cardano Wallet Daedalus is written in JavaScript even though most of the software for Cardano is... Source: about 4 years ago

ClojureScript mentions (17)

  • jQuery v4.0.0 Beta
    LISP in the browser! You end up having to shit a large runtime with your app but it all transpiles to vanilla JS. https://clojurescript.org/. - Source: Hacker News / over 1 year ago
  • Ask HN: Why don't browsers just build a non-JS interpreter?
    JS isn't perfect, but it's good enough. And there is ongoing effort to make it even better. Also, many other languages compile to JS (without WASM). Notably: - https://www.typescriptlang.org/ - https://coffeescript.org/ - https://clojurescript.org/ - https://www.transcrypt.org/ I wrote https://multi-launch.leftium.com, which is only 6% JS. The majority is Svelte (65%) + TypeScript (27%). ( - Source: Hacker News / over 1 year ago
  • Implement functional programming in Sass
    A few years ago, I started learning the ClojureScript language and quickly became fascinated with functional programming. One day, I wondered if it would be possible to implement a similar programming style in Sass, allowing for anonymous functions and threading macros. After conducting some experiments, I came up with the following Sass functions:. - Source: dev.to / almost 2 years ago
  • HTMX is the future
    I also didn't cheat by transpiling Clojure into JavaScript. (see ClojureScript). - Source: dev.to / about 2 years ago
  • Which dialect to choose.
    Clojure has also a mature compiler to JavaScript. https://clojurescript.org/. Source: about 2 years ago
View more

What are some alternatives?

When comparing GHCJS and ClojureScript, you can also consider the following products

Mint - Free personal finance software to assist you to manage your money, financial planning, and budget planning tools. Achieve your financial goals with Mint.

ReasonML - ReasonML is a new face to OCaml that--when coupled with BuckleScript--makes web development easy...

Fay - A proper subset of Haskell that compiles to JavaScript - faylang/fay

Tcl - Already one of the world's best-selling consumer electronics brands, TCL is now the fastest-growing TV brand in North America. TCL TVs feature stylish design and the latest technology.

Web Components - Native/Vanilla web components.

PureScript - PureScript is a small strongly typed programming language that compiles to JavaScript.