TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

First look at Clojure.core.typed

135 点作者 fogus超过 11 年前

11 条评论

apaprocki超过 11 年前
Since no one has said anything about it -- I really admire the willingness to post a recording of oneself attempting to use someone else&#x27;s code. A lot of people would shy away from this because viewers might have arbitrary unrelated criticism (&quot;you type so slow!&quot;). This type of thing could be really useful to authors who can notice if a certain concept isn&#x27;t grasped right away or if documentation didn&#x27;t immediately solve someone&#x27;s need.<p>This is used regularly in UX labs with two-way mirrors and cameras watching how users interact with design -- why should it not be useful to programming as well?
评论 #6301505 未加载
ryanbrush超过 11 年前
A perhaps naive question: could this sort of thing tap into Clojure&#x27;s type hints rather than using external annotations? So rather than writing the example in the post:<p>(ann my-inc [Number -&gt; Number])<p>(defn my-inc [n] (let [internal-number (Integer&#x2F;parseInt &quot;1&quot;)] (+ n internal-number)))<p>one could write this:<p>(defn ^Number my-inc [^Number n] (let [internal-number (Integer&#x2F;parseInt &quot;1&quot;)] (+ n internal-number)))<p>...and then run a type checker that reads and analyzes the hints?<p>Of course, the core.typed annotations could preserve whatever information they need in the compiled output, whereas the type hints aren&#x27;t preserved past the compile phase (as far as I can tell.) Is that the limitation that requires defining type information in separate annotations?
评论 #6297033 未加载
评论 #6296883 未加载
levosmetalo超过 11 年前
For truly typed lisp you should also check Shen. Its type system is built in and very advanced and flexible (based on sequent calculus). You can write programs in both type checked and unchecked mode. One of the supported platforms is also Java.<p>Project is still young and in an early phase, but definitely promising.
评论 #6296050 未加载
评论 #6296543 未加载
klibertp超过 11 年前
Damn it - another unique Racket feature stops being unique.<p>I hoped that in 2020 Racket will be around 5th position in &quot;the most popular language&quot; rankings with Clojure in the first ten too. Now it looks like Clojure is taking the lead - maybe Racket2 will change this again.<p>But hey, either way that&#x27;s a popular, mainstream Lisp! That&#x27;s unprecedented!
评论 #6299016 未加载
评论 #6299824 未加载
评论 #6296791 未加载
评论 #6296708 未加载
moron4hire超过 11 年前
Racket also has a typed version. It seems to be the preferred version for many of the more serious projects.
评论 #6296750 未加载
评论 #6296530 未加载
TylerE超过 11 年前
Admittedly, I&#x27;m only a novice at clojure (working on it), but I find that type error really unfriendly. It doesn&#x27;t provide any clearly actionable information, something like &quot;+ expects it&#x27;s 2nd argument to be Integer, but internal-number is a Number&quot;
评论 #6296479 未加载
boothead超过 11 年前
This looks really nice.<p>I&#x27;ve been wanting to get into clojure (mainly for the web aspect of it) for a while, but as someone who hasn&#x27;t done much lisp and really loves Haskell&#x27;s type system I&#x27;ve been hanging back a bit.<p>I&#x27;m assuming that clojurescript will also work fine with this?
评论 #6296799 未加载
评论 #6296077 未加载
graue超过 11 年前
Forgive me for being the nitpicker on this article, but, dear author: check the CSS font-family on your &lt;pre&gt; tags. You have some proportional fonts in there, and for me on Linux, your code snippets are showing up as proportional fonts which makes them not line up.<p>Specifically, I&#x27;d recommend changing<p><pre><code> font-family: Monaco,Bitstream Vera Sans Mono,Lucida Console,Terminal; </code></pre> to<p><pre><code> font-family: Monaco,Bitstream Vera Sans Mono,Lucida Console,Terminal,monospace; </code></pre> The &quot;monospace&quot; at the end is generic and will always produce a fixed-width font.<p>Great post anyway, thanks!
评论 #6301487 未加载
auggierose超过 11 年前
So, is this also working with Clojurescript?
评论 #6301489 未加载
juskrey超过 11 年前
Is not Rich Hickey in opposition to typing systems? <a href="http://www.reddit.com/r/programming/comments/lirke/simple_made_easy_by_rich_hickey_video/c2u1t1n" rel="nofollow">http:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;lirke&#x2F;simple_ma...</a>
评论 #6300537 未加载
leishulang超过 11 年前
a lein plugin that allows cf-ns all namespaces without firing up repl would be awesome.