Hacker News
Chez from a Clojurian perspective
manoDev
|next
[-]
I managed to build an entire app in Racket that integrates seamlessly with C and ObjC (Apple’s APIs), including Metal.
nefreat
|next
|previous
[-]
drannex
|next
|previous
[-]
hajile
|next
|previous
[-]
e12e
|next
|previous
[-]
> 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
|next
|previous
[-]
Anyone wants to try Chez for a laugh or pleasure
gwerbin
|next
|previous
[-]
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
|next
|previous
[-]
What about Jank (https://jank-lang.org/)?
dapperdrake
|next
|previous
[-]
brudgers
|root
|parent
|next
[-]
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
|root
|parent
|next
[-]
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
|root
|parent
|next
|previous
[-]
In that regard, chez scheme was much better. Haven't tried Emacs lisp, so can't say about that.
pushpankar
|root
|parent
|next
|previous
[-]
- 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
|root
|parent
[-]
dasyatidprime
|root
|parent
[-]
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...
pjmlp
|root
|parent
|next
|previous
[-]
lenkite
|root
|parent
[-]
pushpankar
|root
|parent
|next
|previous
[-]
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.
pjmlp
|next
|previous
[-]
Not really, Scheme has first class support for arrays and hash tables.
pushpankar
|root
|parent
[-]
PuercoPop
|root
|parent
|next
[-]
(let [[a 1]
[b 3]]
(+ a b))
is valid scheme code
arunix
|root
|parent
|next
|previous
[-]
silcoon
|next
|previous
[-]
Interesting reading anyway, kudos!
pushpankar
|root
|parent
|next
[-]
1. it has great performance which I wanted for a text editor.
2. if I ever needed to get to low level, it has great c ffi. I ran some benchmark and c ffi cost was among the best.
DonaldPShimoda
|root
|parent
|previous
[-]
Zambyte
|root
|parent
[-]
I've used a decent amount of Schemes and even contributed to some. It's kind of my understanding that this is the case for all Schemes, really. Most Schemes support multiple versions of the standards (r5rs, r6rs, r7rs) as well as their own non-standard extensions, which are essentially required to be useful.
Saying that Racket supports X language doesn't say much, being a language oriented language - any language can be included as a library. But, as you mentioned, Scheme standards are available through the Racket standard library, which is about as much Scheme as anything you would call a Scheme implementation.
Maybe it's a bit reductionist to call Racket a Scheme implementation, but in general Lisps are always much more than the standards they implement.
DonaldPShimoda
|root
|parent
[-]
sjamaan
|root
|parent
[-]
throwaway27448
|next
|previous
[-]
I'm curious what you're thinking of here. Can you expound?
pushpankar
|root
|parent
[-]
Lets say you want to debug a function.
```
(define (f1 arg1 arg2)
;; body calls f2 and others
)```
Now you can capture the continuation just before the body of the f1. Then, you can use chez's eval-in-continuation to evaluate the updated body of the function. Once you are satisfied, you can continue the continuation with output. If there is problem in f2, you can update f2 and retry from f1 again. You can walk up/down the continuation stack to go back to different point and try from there.
Similarly, you can declare a function, implement its body, eval-in-continuation, update the body until you are satisfied, and then move on to next thing.
Almost all features are there. It just needs a good editor support and some ux design.
nathell
|previous
[-]
brabel
|root
|parent
|next
[-]
0_gravitas
|root
|parent
[-]
You can see a compiled list of dialects and what host/space they target here if you're interested: https://clojure.cc/dialects/