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.

Fantasy World OCaml (2013)

76 pointsby a0almost 11 years ago

6 comments

jeffreyrogersalmost 11 years ago
I'm surprised that better threading wasn't mentioned. As I understand it, OCaml has threads but parallelism isn't possible. That is, although you can have multiple threads, only one can execute at a time.
评论 #8127177 未加载
评论 #8127182 未加载
talex5almost 11 years ago
Generally sensible, but a few things seem already fixed.<p>The duplicate argument thing already generates a warning (I wish warnings were enabled by default though):<p><pre><code> # let f x x = x;; Warning 27: unused variable x. val f : &#x27;a -&gt; &#x27;b -&gt; &#x27;b = &lt;fun&gt; </code></pre> &quot;Values of type string and bytestring are not mutable.&quot; In 4.02, strings can be made immutable (it&#x27;s optional currently, to avoid breaking existing code).<p>Camlp4 is already on the way out, being replaced by Extension Points.<p>Rather than adding checked exceptions, I&#x27;d rather just see more use of variants in the standard library (3rd-party libraries mainly do this already). I don&#x27;t see why checked exceptions should be faster - maybe this is just a compiler optimisation problem?
lpw25almost 11 years ago
Most of these things seem nice but are actually a bad idea. Many of the rest are already implemented or in the process of being implemented. A couple of them are good ideas which are awkward to implement due to politics (e.g. the licence) or backwards compatibility.<p>Still, I enjoyed reading the post, and it is good to see people looking to improve OCaml and make suggestions.
评论 #8128705 未加载
PieSquaredalmost 11 years ago
I would be interested in seeing a similar list for Haskell. Like OCaml, it&#x27;s a great language, but definitely has a few long-standing warts that could be fixed. (Among these, the many competing streaming libraries and cabal hell come to mind. Though maybe the first ain&#x27;t so bad, since they are all pretty high-quality.)
评论 #8128098 未加载
rwmjalmost 11 years ago
I would like to see a &#x27;return&#x27; statement added to the language, so that:<p><pre><code> fun () -&gt; if foo then return r; more code ... </code></pre> is the equivalent of:<p><pre><code> fun () -&gt; if foo then r else more code ... </code></pre> Note that type safety would obviously have to be preserved. The returned type would have to match the return type of the overall function.
评论 #8128108 未加载
评论 #8127719 未加载
microcolonelalmost 11 years ago
Unicode support is the biggest problem I have with OCaml, and it&#x27;s something I noticed immediately as I tried to put in messages and keywords for a japanese friend.<p>It may not be wise to break current behaviour of the char and string types, but their literals should at least support unicode escapes. One way to do this would be to bring in UCS-4&#x2F;UTF-32 strings as offered by Camomile, and have some simple convention to allow UCS-4 strings to be mapped from what are UTF-8 literals in the code.
评论 #8127594 未加载