Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-30 Thread Shantanu Kumar
Sorry for a late reply to the thread. This release is pretty cool. I haven't been following the development too closely, so I have two questions: 1. Is ClojureScript/ClojureCLR supported by core.typed? Or, is it planned? 2. Is there a Leiningen plugin that can help run the type checks from the

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-30 Thread Ambrose Bonnaire-Sergeant
Hi Shantanu, CLJS support is planned but not current plans to work on CLR myself. No leiningen plugins yet, FWIW I tend to add type checks to my unit tests like: (is (check-ns 'my.ns)) Thanks, Ambrose On Sat, Aug 31, 2013 at 4:13 AM, Shantanu Kumar kumar.shant...@gmail.comwrote: Sorry for

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Daniel
Couldn't occurrence typing catch the error in that example, since evil-atom-reset! can only return an atom wrapping a keyword? I guess the problem I had is that the optional typing moniker seems misleading since it forces you to annotate vars. I had visions of gradually assigning types to

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Jozef Wagner
How about annotating clojure.core API. Is it needed, provided, optional? On Thursday, August 29, 2013 12:28:35 AM UTC+2, Ambrose Bonnaire-Sergeant wrote: Hi, After 10 months and 26 0.1.x releases of transitioning core.typed from an ambitious student project, I am finally comfortable

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
I see optional typing as the opposite of mandatory typing. You don't need to pass a type checker to get a program semantics. Typed Clojure offers a particular flavour of optional typing: gradual typing. My interpretation of gradual typing is some of your code is rigorously statically typed, some

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
Hi, Roughly 1/3 of clojure.core is annotated and comes included with core.typed. They are unchecked annotations. https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/base_env.clj#L658 You can lookup types via cf at the REPL. (clojure.core.typed/cf +) ;= (Fn

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
Also you can add missing annotations via ann. (ann ^:no-check clojure.core/+ ) Core vars observe the same rules as all vars: they must be annotated. Thanks, Ambrose On Thu, Aug 29, 2013 at 3:44 PM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: Hi, Roughly 1/3 of

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Nils Grunwald
Congratulations and thanks for your work! On Thursday, August 29, 2013 12:28:35 AM UTC+2, Ambrose Bonnaire-Sergeant wrote: Hi, After 10 months and 26 0.1.x releases of transitioning core.typed from an ambitious student project, I am finally comfortable recommending core.typed for

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Christian Sperandio
Is there any perf improvement to use static typing in Clojure? Like we can see with Groovy 2.x and its static mode. 2013/8/29 Nils Grunwald nils.grunw...@gmail.com Congratulations and thanks for your work! On Thursday, August 29, 2013 12:28:35 AM UTC+2, Ambrose Bonnaire-Sergeant wrote:

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Michael Klishin
2013/8/29 Christian Sperandio christian.speran...@gmail.com Is there any perf improvement to use static typing in Clojure? core.typed is not a compiler, it's a type annotation/checker implemented as a library. If you are familiar with Erlang, it is to Clojure what Dialyzer is to Erlang. --

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Christian Sperandio
Ok... Another question, the checking is done only once (while compiling) ? Or, it's done while the runtime? 2013/8/29 Michael Klishin michael.s.klis...@gmail.com 2013/8/29 Christian Sperandio christian.speran...@gmail.com Is there any perf improvement to use static typing in Clojure?

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
With Clojure the lines blur between compile time and runtime. The clearest way to put it is that type checking is explicitly called at the REPL or in a unit test. Usually this is done during development iterations or testing time. Re: performance improvements: Michael is correct. Interestingly

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Daniel
If you can do that, why not return the literal representation of the type hinted function? For the repl you could provide a function that interns the type-hinted function into the namespace by evaluating the literal representation first. From there it's easy to provide something like

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
I don't think it would be possible to reconstruct the original forms in general, you would need to reverse macroexpansion to provide a form that has at least a passing familiarity with the original form. Otherwise you would get fully macroexpanded forms. That's a lot of work! On Thu, Aug 29,

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Daniel
Those forms won't be in the namespace you're evaluating? Yeah, it's probably a lot of work, but it sounds neat. :-) On Thursday, August 29, 2013 9:07:26 AM UTC-5, Ambrose Bonnaire-Sergeant wrote: I don't think it would be possible to reconstruct the original forms in general, you would

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
Well I'm sure people wouldn't be happy if their call to (+ a b c) was suddenly turned into (clojure.lang.Numbers/add (clojure.lang.Numbers/add a b) c) :) On Thu, Aug 29, 2013 at 10:57 PM, Daniel doubleagen...@gmail.com wrote: Those forms won't be in the namespace you're evaluating? Yeah,

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Maik Schünemann
On Thu, Aug 29, 2013 at 5:01 PM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: Well I'm sure people wouldn't be happy if their call to (+ a b c) was suddenly turned into (clojure.lang.Numbers/add (clojure.lang.Numbers/add a b) c) :) the expresso [1] optimizer can be used for

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Alex Baranosky
Imo, there's nothing easy about writing something like Slamhound. Even after many iterations it can't handle macros, because ultimately they're impossible, without some kind of hints specifically added for Slamhound (or for Typed Clojure) :) -- -- You received this message because you are

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Daniel
Yeah, it's pretty much impossible unless you limit yourself to a manageable subset of Clojure. The easy part I was referring to was the Leiningen plugin, not the whole kit n' caboodle. On Thursday, August 29, 2013 11:02:17 AM UTC-5, Alex Baranosky wrote: Imo, there's nothing easy about

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
Just pushed 0.2.1 based on feedback from the video on HN. https://github.com/clojure/core.typed/blob/master/CHANGELOG.md Thanks, Ambrose On Thu, Aug 29, 2013 at 6:28 AM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: Hi, After 10 months and 26 0.1.x releases of transitioning

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-28 Thread Allen Rohner
Awesome. Thanks for your hard work! Allen On Wednesday, August 28, 2013 3:28:35 PM UTC-7, Ambrose Bonnaire-Sergeant wrote: Hi, After 10 months and 26 0.1.x releases of transitioning core.typed from an ambitious student project, I am finally comfortable recommending core.typed for

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-28 Thread Daniel
Excellent work. I noticed that function parameter types default to Any when not Annotated. What was the reasoning behind not mirroring this behavior for vars, and instead requiring an annotation? On Wednesday, August 28, 2013 5:28:35 PM UTC-5, Ambrose Bonnaire-Sergeant wrote: Hi, After

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-28 Thread Ambrose Bonnaire-Sergeant
Hi Daniel, It is unsound to assume we can pass anything to an unannotated, unchecked var. core.typed makes the user explicitly mark unchecked vars, which is also a source of unsoundness, but an explicit one. Hopefully :no-check is not ambiguous in this regard. Take this example. ;; untyped