Chez Scheme from a Clojurian Perspective

(get-aksh.com)

15 points | by pushpankar 2 days ago

3 comments

  • nathell 10 minutes ago
    These days we also have Jolt, a vibecoded Clojure implementation on top of Chez!

    https://jolt-lang.net/

  • pjmlp 43 minutes ago
    > Scheme uses lists for almost everything

    Not really, Scheme has first class support for arrays and hash tables.

    • pushpankar 35 minutes ago
      I didn't mean list data structure for everything. I meant list for representing all code whereas clojure uses vector, map literal, and other syntax
      • arunix 8 minutes ago
        Are you comparing Clojure to Scheme in general? Would the same thinking apply to Chicken or any other standard Scheme?
      • rscho 13 minutes ago
        Scheme also has literals for vectors.
      • antonvs 10 minutes ago
        Scheme has a standard vector type with corresponding syntax (since 1985), and as of the R6RS version, a standard bytevector type. Some Scheme dialects like Racket and Gauche have map literal syntax as well.
  • dapperdrake 2 days ago
    Clojure really seems like a good way to learn lisp. Broke homoiconicity just enough.
    • pjmlp 40 minutes ago
      For me, having learnt Lisp in the old days, Clojure's advantage is how it embraces its host instead of having an antagonist attitude like other guest languages happen to be like.
    • pushpankar 2 days ago
      Yeah, clojure is well thought out language from developer experience perspective. It makes things which will bite you down the line not default like mutation but uses mutation for things like vars when cost outweighs benefit(in this case, aids in interactive development). I had read somewhere that clojure's namespace are great but didn't fully comprehend it. But now I do. It treats namespace as values which comes handy in testing, mocking, and introspection, all of which is big deal in maintaining project over the long run.

      Clojure does the right thing most of the time but chooses to do something dirty for practicality. Top one being macros. I think using fully qualified namespaces during macro expansion gives you most of the benefit of hygiene while being easy to comprehend.

      The only problem it has is its slow startup for desktop apps.

    • brudgers 16 hours ago
      I haven't played with Clojure for a long time, so take that as a caveat.

      My experience was that Clojure errors were often described in terms of the underlying Java Code and because I did not know much Java error messages were often inscrutable.

      Which is not a criticism of Clojure because Clojure was designed to improve JVM programming experience and was implemented as a Java library (and pitched to managers as "it's just a Java library").

      Again all that may be irrelevant today. But for what it's worth, Emacs lisp might be the best way to learn lisp because Emacs is more or less a virtual lisp machine if you squint hard enough.

      • OskarS 47 minutes ago
        > But for what it's worth, Emacs lisp might be the best way to learn lisp because Emacs is more or less a virtual lisp machine if you squint hard enough.

        This is really true. Emacs Lisp is a much worse Lisp than Scheme (dynamic binding instead of lexical binding by default is the most obvious thing, though of course you can opt in to it), but the thing Emacs Lisp does is that it really nails the "interactive coding" experience. Like, you just edit and run code from inside the thing that is running the code, it's really cool. It makes the "Lisp machine" thing click better than anything else I've used.

        I used gone from vim -> emacs -> neovim (sometimes embedded in vscode) as my editor of choice, and the interactive environment thing is one of the things I miss most from emacs.

      • pushpankar 39 minutes ago
        Somehow, I always had the feeling that emacs lisp is tied closely to emacs only.

        - How is the performance of emacs lisp?

        - In terms of feature set, is it close scheme or common lisp?

        - Any feature/concept that would be new to programmer who know scheme, clojure, and python

        If i am ever going to try a new language, it would need a good ide. I know people say they don't need ide, since AI make changes, but I still need one to review code. I can't simply look at diff and understand. I need to see actual code. I guess emacs lisp will have good ide support, otherwise it would be ironical.

        • rscho 10 minutes ago
          Emacs lisp is closer to common lisp. It inherits some stuff from older lisp systems, the most prominent being dynamic scope by default.
      • pushpankar 53 minutes ago
        My problem with clojure's error is that it doesn't show up where you made the mistake. Because of nil punning, you will see error happen few steps down the line and usually it isn't clear from error message what went wrong.

        In that regard, chez scheme was much better. Haven't tried Emacs lisp, so can't say about that.

      • cassepipe 1 hour ago
        Aren't there other implementations on other runtimes by now ?