Re:Why is Jepsen written in Clojure?
by smw on Wednesday December 06, 2023 @09:38AM
(#38544440)
Isn't that true in most common languages? Python and Ruby and Java and Go (panics) will all spit out the stacktrace?
[ Parent
| on HN ]
This is about compile-time errors, not runtime errors.
Re:Why is Jepsen written in Clojure?
by scotty79 on Wednesday December 06, 2023 @04:19PM
(#38549604)
Clojure spits out Java stack trace if you make syntax error. It's equivalent of Python barfing segfault when you put tab in the wrong place.
This doesn't happen with the normal REPL (or invoking with clj -X) after a couple of first examples that came to mind:
user=> (defn foo [[a b] (+ a b))
Syntax error reading source at (REPL:14:26).
Unmatched delimiter: )
user=> (defn foo [a b] a/b)
Syntax error compiling at (REPL:1:1).
No such namespace: a
user=>
It will give you a stack trace of the compiler when asked following a syntax error though, with a disclaimer not to confuse it with your own code: user=> (pst)
Note: The following stack trace applies to the reader or compiler, your code was not executed.
CompilerException Syntax error compiling at (1:1). #:clojure.error{:phase :compile-syntax-check, :line 1, :column 1, :source "NO_SOURCE_PATH"}
clojure.lang.Compiler.analyze (Compiler.java:6808)
clojure.lang.Compiler.analyze (Compiler.java:6745)
[...]
Possibly you were using tooling that always tried to present the stack trace without discerning between kinds of evaluation errors?