TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

First look at Clojure.core.typed

135 pointsby fogusover 11 years ago

11 comments

apaprockiover 11 years ago
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 未加载
ryanbrushover 11 years ago
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 未加载
levosmetaloover 11 years ago
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 未加载
klibertpover 11 years ago
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 未加载
moron4hireover 11 years ago
Racket also has a typed version. It seems to be the preferred version for many of the more serious projects.
评论 #6296750 未加载
评论 #6296530 未加载
TylerEover 11 years ago
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 未加载
bootheadover 11 years ago
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 未加载
graueover 11 years ago
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 未加载
auggieroseover 11 years ago
So, is this also working with Clojurescript?
评论 #6301489 未加载
juskreyover 11 years ago
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 未加载
leishulangover 11 years ago
a lein plugin that allows cf-ns all namespaces without firing up repl would be awesome.