Skip to content

Instantly share code, notes, and snippets.

@metacritical
Last active September 2, 2022 00:43
Show Gist options
  • Save metacritical/dcbe23b928de9dab651820a4386bb90b to your computer and use it in GitHub Desktop.
Save metacritical/dcbe23b928de9dab651820a4386bb90b to your computer and use it in GitHub Desktop.
Racket-Lisp-Scheme-Clojure Rant and Answers.

Two gentlemen and their rant on languages.

Rant

  • Racket & scheme are orders of magnitude faster than clojure.
  • I like lisp but I hate this clojure movement. Especially when 60% of it is written in Java.
  • Are there major java libraries for which there is no scheme implementations?
  • Why did people pick up clojure rather than racket. Hype?

Solutions/Answers :

  • Racket (Special Scheme) and 40 other schemes are not orders of magnitude faster. The performance characteristics of JVM are quite good certainly Racket VM cannot be as good as JVM, unless maybe you are referring to startup speed? Very few VM's have performance as good or better than JVM, probably V8 and LuaJIT are the outliers.

  • What difference does it make if clojure is written in Java? Do you hate Ruby because it is written in C? or for that matter every other language? Besides there are many other implementations available for clojure. There is Clojure on CLR/.NET written in C# , There in ClojureC written in C++, there is ClojureScript implementation like Lumo written in Clojure and JS that compiles to JS.

  • Java has good IO libs for almost everything. Pick any DB you will find drivers for it in Java. I dont think that is the case with other schemes. Also Java Libs are battle tested and stable after years of production use, we cant say that even about Go. The biggest reason we moved from Go to Scala for using spark were shitty drivers. Also Druid DB drivers were written in Scala so we thought better to move to scala than trying to fix stuff in Go. I think good Database drivers are a big concern atleast in enterprise or areas where they might see huge scale and volume of data.

  • Racket when compared to Clojure has all the same things missing as any other scheme. Clojure is a better lisp.

    • For instance look at hash implementation in Racket Hash Table Besides syntax it asks me to keep in mind so many ideosyncracies. Like weak-hash, Who asked for a hash that may get garbage collected? Then the daunting syntax:
    • Racket :
    (define my-hash (make-hash))
    (hash-set! my-hash 'a 1)
    (hash-set! my-hash 'b 2)
    • Clojure :
    (def my-hash {:a 1 :b 2})

    I prefer the latter.

    • Lets look at a vector (array) now :
    • Racket :
    (vector '1 '2 '3)
    #(1 2 3)

    These are fixed length vectors? Yup!

    • Clojure :
    [ 1 2 3 ]

    There are many subtle things like these which makes clojure so lovable, scheme is still a better lisp than common lisp but both Racket and Clojure are built for different purposes. Also RnRS has been slow and academic to add Srfi. So there are many reasons to choose clojure besides the obvious hype which exists for almost every Opensource project. Hype is a big part of the marketing since OSS has no budget!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment