Top
Best
New

Posted by pushpankar 2 days ago

Chez from a Clojurian perspective(get-aksh.com)
69 points | 44 comments
manoDev 4 hours ago|
I’ve used Clojure professionally for almost a decade, but lately I’ve been working with Racket for personal projects - super fast, can build binaries, has GUI library, C FFI (and AI helps a ton here writing all the boilerplate).

I managed to build an entire app in Racket that integrates seamlessly with C and ObjC (Apple’s APIs), including Metal.

https://revelar.riq.net.br

charan345 1 hour ago|
[dead]
drannex 14 minutes ago||
Love Chez, but there seriously needs to be an organization willing to put together resources, events, tutorials, and better documentation than there currently is. Just dropping a PDF of spec is a slog to get through to really learn how incredible this language is.
nefreat 3 hours ago||
There's a dialect of Clojure (https://github.com/jolt-lang/jolt) built on top of Chez Scheme.
hajile 1 hour ago||
All of this reads like they should have used Common Lisp or Coalton instead.
e12e 4 hours ago||
Interesting article! I would have loved to see some examples of clojure vs chez, especially:

> On the other hand, lack of generic data structures and functions encourages you to make records for cases where you use maps, and create domain-specific functions. In Clojure you treat your program as a data processing pipeline whereas in Chez you talk more in terms of domain entities.

And contrasting let-syntax with clojure.

vegnus 4 hours ago||
https://margeux.com/chez.html

Anyone wants to try Chez for a laugh or pleasure

gwerbin 1 hour ago||
Chez is a rather stripped-down Scheme, and it's also an R6RS which can be kind of clunky.

If you're a Clojure user you might want to try Gauche or (my favorite) Guile for a more Python-like standard library experience.

Or you can try one of the JVM-based Schemes like Kawa.

mcc1ane 6 hours ago||
> but its startup time wasn't ideal for a text editor.

What about Jank (https://jank-lang.org/)?

pushpankar 6 hours ago|
Jank is quite promising. I choose chez because I was interested in learning continuation, hygenic macros, and condition systems.
dapperdrake 2 days ago||
Clojure really seems like a good way to learn lisp. Broke homoiconicity just enough.
brudgers 22 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 7 hours 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 7 hours 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.

pushpankar 7 hours 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 6 hours ago||
Emacs lisp is closer to common lisp. It inherits some stuff from older lisp systems, the most prominent being dynamic scope by default.
dasyatidprime 5 hours ago||
Some clarifications:

Common Lisp uses lexical binding for locals by default. (I think you meant this, but the wording seems ambiguous to me on whether “older Lisp systems” means “older than Common Lisp” or “older in general, including Common Lisp which is itself old”, so I wanted to say it more explicitly.)

Emacs Lisp is currently expecting to switch in the future from dynamic binding by default to lexical binding by default, which is why lots of Emacs users are getting the current transitional flood of annoying warnings about elisp files that don't have the expected “lexical-binding: ‹boolean›” metadata at the top. And yes, that cookie is a reuse of the “set some local state for buffers visiting this file” mechanism, more commonly used for things like major mode and fill column (expected line length), for programming language dialect switching!

Here's the node about this in the current online version of the official manual: https://www.gnu.org/software/emacs/manual/html_node/elisp/Se...

cassepipe 7 hours ago|||
Aren't there other implementations on other runtimes by now ?
pjmlp 7 hours 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.
lenkite 6 hours ago||
Its kind of amazing. Can write bespoke Clojure code for game mods, neovim text editor, dotnet/java services, etc thanks to embracing its host. Sure, without type-safety, there is an upper complexity limit to the code-base size you can comfortably grok. However its immutability, cohesive core and stable+mature libraries puts that grokkability bar far higher compared to other dynamic ecosystems.
zelphirkalt 2 hours ago||
I think immutability comes with an implicit requirement: Having a good number of immutable data structures in the standard library. Clojure seems to have that.
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.

lgas 6 hours ago||
How does Clojure break homoiconicity?
regularfry 2 hours ago||
I don't think it does. When I've seen similar comments before it's boiled down to the syntax being more than just atoms, lists, and quoting, but using vectors and maps in the syntax doesn't mean macros can't work with them.
pjmlp 7 hours ago|
> Scheme uses lists for almost everything

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

pushpankar 7 hours 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
PuercoPop 1 hour ago|||
That is also wrong. Scheme uses syntax objects for syntax. If you meant the brackets they use in certain places, in Chez Scheme and other schemes you can replace parens with square brackets where as you see fit. e.j.

  (let [[a 1]
        [b 3]]
    (+ a b))
is valid scheme code
arunix 6 hours ago||||
Are you comparing Clojure to Scheme in general? Would the same thinking apply to Chicken or any other standard Scheme?
pushpankar 6 hours ago||
I am only familiar with Chez scheme and in the article I comparing that only. My apologies if it wasn't clear from the title of the blog.

> any other standard Scheme?

Every scheme has different featureset that they add on top of R5rs/R6rs.

arunix 6 hours ago||
It's also not clear from the body of the blog which features of Chez (beyond standard Scheme) you are referring to.
rscho 6 hours ago||||
Scheme also has literals for vectors.
antonvs 6 hours 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.
More comments...