Live data from Hacker News

Clojure 1.11 planning

insideclojure.org

41–50 of 72 posts

Re: Clojure 1.11 planning

#41
post #11

Earlier quoted context omitted.

This is why guest languages tend to fade away, as the platform evolves and the platform system languages adopt the features that made those guest languages appear in first place.

I'm looking at the docs -- is there a guide for targeting new host langs? As a starting point, what is the minimum "core" language that needs to be defined in the host lang so that the rest of the system can be bootstrapped by Clojure libs? (Clojure.core doesn't seem to be the answer -- there seem to be plenty of non-core/prim functions defined there. Also, are Clojure libs (either automatically or via attribute on t…

Yes, the special forms.

https://clojure.org/reference/special_forms

Clojure follows the Lisp convention of providing platform specific behaviour via the reader.

https://clojure.org/guides/reader_conditionals

Re: Clojure 1.11 planning

#42
post #5
post #3

I enjoy Clojure and spec is very interesting; but it remains uncertain if I have any problems that spec will solve. I'm not really that interested in the generative testing aspect since I write mostly amateur code. So I can't figure out if it is more like a debugger for targeted location of difficult bugs or more like compiler error messages where it becomes a pervasive part of the workflow. There is obviously someth…

Spec is great for validation. For example, we have a HTTP API built using https://github.com/metosin/reitit where we have specs for each endpoint. We have a coercion middleware that checks each request (and optionally response) conforms to a spec (and coerces things like integer ids from path to the correct type). And there's a swagger handler that automatically generates a full documentation of the API just from the…

I have a somewhat off-topic question I've been wondering about... How do you pronounce "reitit"? I've been considering giving a talk on it at my local clojure group, so I should probably learn how to actually say the word!

Re: Clojure 1.11 planning

#43
post #41

Earlier quoted context omitted.

I'm looking at the docs -- is there a guide for targeting new host langs? As a starting point, what is the minimum "core" language that needs to be defined in the host lang so that the rest of the system can be bootstrapped by Clojure libs? (Clojure.core doesn't seem to be the answer -- there seem to be plenty of non-core/prim functions defined there. Also, are Clojure libs (either automatically or via attribute on t…

Yes, the special forms. https://clojure.org/reference/special_forms Clojure follows the Lisp convention of providing platform specific behaviour via the reader. https://clojure.org/guides/reader_conditionals

Not sure I follow -- there are certainly many primitives that must be defined by the host to bootstrap that are not special forms -- starting with list, cons/conj...

Re: Clojure 1.11 planning

#44
post #11

Earlier quoted context omitted.

Clojure is a different language. Being "fully compatible" with (more similar to) Java was never a goal.

This is why guest languages tend to fade away, as the platform evolves and the platform system languages adopt the features that made those guest languages appear in first place.

Kotlin seems promising (because of android).

Re: Clojure 1.11 planning

#45

Spec is very useful, but please implement it without macros. Metosin did a great job to make it more usable, but we still struggle because specs could only exist in Namespaces. We want to use spec as EDN with pure functions. (+ recursive specs would be awesome)

For schemas as EDN you might want to take a look at malli: https://github.com/metosin/malli

I didn't know malli, thank you Borkdude!

Re: Clojure 1.11 planning

#46
post #16

Cool, cool. When is full compatibility with Java 8 be available? I mean Java 8 SAMs, Java 8's Stream, Optional and CompletableFuture...

What parts of compatibility are missing? The interop works just fine, as with all other Java. ; example: Stream.of(1,1,2,3,5).map(x -> 2*x).collect(Collectors.toList()) user=> (.. (java.util.stream.Stream/of (to-array [1 1 2 3 5])) (map (reify java.util.function.Function (apply [this x] (* 2 x)))) (collect (java.util.stream.Collectors/toList))) [2 2 4 6 10] Of course it's not practical to convert lists and functions…

so no Java Function to clojure Function automating mapping ? do people use macros to make it nicer ?

Re: Clojure 1.11 planning

#47

Spec is very useful, but please implement it without macros. Metosin did a great job to make it more usable, but we still struggle because specs could only exist in Namespaces. We want to use spec as EDN with pure functions. (+ recursive specs would be awesome)

Spec 2 can be used without touching any macros if desired and has a lot more programmatic options.

Awesome!

Re: Clojure 1.11 planning

#48
post #33

Earlier quoted context omitted.

I did, but it was a bit stale a year or so ago (as in it wouldn't even work with the Unity build at the time). Which is too bad, since one of my kids is doing Unity micro-games and I would like to have alternatives...

Development has picked up again AFAIK, saw one of the developers give a short demo/talk on it recently and it seems neat. Godot is a decent OSS alternative to Unity, but no Clojure/Lisp so far as I know :(

Yup, Ramsey gave a talk at Clojure/north [1] about Arcadia. I got a chance to briefly chat with him, and it looks like they actually managed to raise funding to develop it further.

And somebody made Arcadia bindings for Godot [2], but the project isn't actively maintained. Would be great if somebody picked it up again.

[1] https://www.youtube.com/watch?v=LbS45w_aSCU [2] https://github.com/arcadia-unity/ArcadiaGodot

Re: Clojure 1.11 planning

#49
post #5

Earlier quoted context omitted.

Spec is great for validation. For example, we have a HTTP API built using https://github.com/metosin/reitit where we have specs for each endpoint. We have a coercion middleware that checks each request (and optionally response) conforms to a spec (and coerces things like integer ids from path to the correct type). And there's a swagger handler that automatically generates a full documentation of the API just from the…

I remember spec being pitch for something you only use at dev time and turn off in production because it makes your runtime very very slow, what has change? Seems users are using it for everything now.

I bet you are thinking of https://clojure.org/guides/spec#_instrumentation_and_testing - it was always just one use of spec among many.

Re: Clojure 1.11 planning

#50
post #16

Earlier quoted context omitted.

What parts of compatibility are missing? The interop works just fine, as with all other Java. ; example: Stream.of(1,1,2,3,5).map(x -> 2*x).collect(Collectors.toList()) user=> (.. (java.util.stream.Stream/of (to-array [1 1 2 3 5])) (map (reify java.util.function.Function (apply [this x] (* 2 x)))) (collect (java.util.stream.Collectors/toList))) [2 2 4 6 10] Of course it's not practical to convert lists and functions…

so no Java Function to clojure Function automating mapping ? do people use macros to make it nicer ?

you'd use Clojure not Java for an example like the above
Post reply on HN