You might be interested in how we provide type-based annotations on Clojure functions so that tooling (in our case New Relic) sees those annotations:
https://corfield.org/blog/2013/05/01/instrumenting-clojure-for-new-relic-monitoring/
I agree that this could be a lot easier.
Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clo...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/beca47df-4227-4d08-a71f-0e98e34a7acf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Two reasons:
Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
I got the impression this was the primary reason for Storm’s rewrite:
While Storm's Clojure implementation served it well for many years, it was often cited as a barrier for entry to new contributors. Storm's codebase is now more accessible to developers who don't want to learn Clojure in order to contribute.
Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/MWHPR2201MB1134DA8985E3FEBE75B43B63F4E60%40MWHPR2201MB1134.namprd22.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/Yi922qYALg8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CA%2Bc2dWeiUnbb23R1fwaEE8PCx7R4gVYdb_6r0SwRTUcCpVhPsg%40mail.gmail.com.
Nathan,
For the subset of problems for which clojure has insufficient power to optimize well, I think a good percentage of those would be best off solved by numeric languages like numpy or a numeric compiler like TVM as this gives you a pathway to much more scalability and performance in the end. In short, they aren't best solved by Java either but best solved via translation to, execution in, and then translation back from a numeric form. Aided by 4 years of understanding the problem this sort of transformation should definitely be possible.
The best person I found who learned clojure fast was already very good at python and used Koans. I think it should be reasonable to stay within some of the extent of the language described in things like the Koans for the majority of the codebase and still provide a pathway for new people.
That's a lot of thinking for a weekend :-). Thanks for the post it was interesting!
Chris
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/beca47df-4227-4d08-a71f-0e98e34a7acf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I think it isn't very clear from the wording. They didn't just rewrite it in Java, they also changed the architecture:
> Storm 2.0.0 introduces a new core featuring a leaner threading model, a blazing fast messaging subsystem and a lightweight back pressure model
So it is hard I think to do an apples to apples comparison. In my opinion, a system like Storm will fundamentally be more limited by its architecture in performance than the language it uses.
That said, even if I think the performance improvements are probably mostly due to architectural changes they also made. It shouldn't come as a surprise that Java would be faster than Clojure in most cases. I don't want to make false pretenses. Clojure and Java are not equal in semantics, and Java's mutable, eager and object grouped methods semantics are almost always going to be more performant. Clojure makes a trade offs of performance and memory for simplicity.
When people say Clojure can match Java in performance, it almost always implies using escape hatches and changing the semantics back to imperative code. The good news though, when you use Clojure's semantics, you benefit in simplicity and the performance impact is marginal, so it is still fast enough for almost all use cases.
Now, back to type annotations. I really don't think Storm 2.0 performance improvements were due to usage of reflection that hadn't been addressed from Clojure. But who knows.
Do the framework you're talking about do static analysis of the types? Because generic types are erased at runtime, so there wouldn't ever be a way for proxy to set them in.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
// pseudo-ish code
public class MyFn extends BeamFn<Integer, String> implements Serializable {
public MyFn(Var fn) { this.fn = fn; }
@Override public String invoke(Integer input) { return (String) fn.invoke(input); }
}
;; pseudo-ish code
(defn my-fn [^Integer val] ...return a string...)
...
(register-beam-step (MyFn. #'my-fn))
...
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clo...@googlegroups.com.
OK that makes more sense, BeamFn
is not an interface. I imagine they argued about that decision at some point.
In your example, MyFn
looks to be a general class as it can work with any clojure var. Do you have a package with many of these type of stub classes defined? I mean, you could name it BeamFnIntegerString
thus encoding the specializations of the baseclass into the type. One of my questions was about the range of types that end up specializing the BeamFn<>
.
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/6c1a93e7-b25b-4199-a41a-9308b231ffc1%40googlegroups.com.