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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Crystal 1.1.0

248 点作者 bornelsewhere将近 4 年前

9 条评论

arc-in-space将近 4 年前
Finding a description of what the language is actually about on the home page was hard, so here it is: <a href="https:&#x2F;&#x2F;crystal-lang.org&#x2F;api&#x2F;1.1.0&#x2F;" rel="nofollow">https:&#x2F;&#x2F;crystal-lang.org&#x2F;api&#x2F;1.1.0&#x2F;</a>
评论 #27908806 未加载
评论 #27907999 未加载
Normille将近 4 年前
The language itself is very interesting. I&#x27;ve dabbled a few times and really like the clean ruby-esque syntax.<p>What puts me off delving further is the lack of support in various editors &#x2F; IDEs &#x2F; Treesitter etc. I think the core development team should really devote some resources to this, as I&#x27;m sure I&#x27;m not the only one deterred by this dearth of tooling.
评论 #27903809 未加载
评论 #27904139 未加载
评论 #27904304 未加载
评论 #27904091 未加载
评论 #27903830 未加载
评论 #27909223 未加载
评论 #27904052 未加载
dengolius将近 4 年前
There are published video from the latest Crystal 1.0 Conference<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;postmodern_mod3&#x2F;status&#x2F;1417673689244467201" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;postmodern_mod3&#x2F;status&#x2F;14176736892444672...</a>
ptrwis将近 4 年前
Look at their improvement (2x) in HTTP&#x2F;RPS after moving to io_uring. It&#x27;s not there yet though<p><a href="https:&#x2F;&#x2F;github.com&#x2F;crystal-lang&#x2F;crystal&#x2F;issues&#x2F;10740" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;crystal-lang&#x2F;crystal&#x2F;issues&#x2F;10740</a>
评论 #27905550 未加载
评论 #27906081 未加载
valbaca将近 4 年前
BLUF: I love crystal and can&#x27;t wait for it to get the attention I think it deserves.<p>To give a bit of history of myself and programming languages, I first started as an EE&#x2F;CS major working with ASM&#x2F;C&#x2F;C++&#x2F;Matlab for EE and C++&#x2F;Java&#x2F;Lisp for CS. Up until graduation, it was just a given that programming languages were just a concession given to you so you didn&#x27;t have to write assembly. OO in the form of C++&#x2F;Java was the &quot;better alternative&quot; to imperative C. Lucky me.<p>Then I heard about Ruby and Ruby on Rails. After reading &quot;The Ruby Programming Language&quot; and working through the examples, I was blown away by the idea that a language could be <i>for a programmer</i> and be a way to express ideas rather than something we translate ideas into. Metaprogramming and mixins and Procs oh my.<p>Then I started working through Project Euler questions with Ruby and it all came crashing down with the reality of Ruby&#x27;s runtime. Ruby gave me expressiveness but just could&#x27;t give me the speed of my equivalent C&#x2F;Java code. Granted, I was definitely doing very sub-optimal algos but even then, C&#x2F;Java just didn&#x27;t care and gave the answer in seconds, not minutes.<p>Since then, Java &amp; JS have paid my bills. I&#x27;ve seen the popularity of Ruby die as Rails fell out of style when Twitter moved away.<p>I&#x27;ve messed around with Crystal, trying to work through the problems in &quot;The Go Programming Language&quot; in Crystal and finding that Crystal is a beautiful language and fast as hell. That said, there&#x27;s always a trade-off right? Crystal&#x27;s trade off is in compile time, especially with --release. However, I think that&#x27;s a reasonable trade-off since your release builds should be on a beefy server and it could save you $$$ if it means your actual production servers can be lean as hell. That said, I&#x27;m also aware that this problem is exactly one that the Go language was meant to address (C++&#x27;s exponentially growing compile time).<p>Crystal definitely needs:<p>1. IDE&#x2F;Debugger support, understandable for a new language, but the language should be &quot;finished&quot; and tooling needs critical attention<p>2. Libraries. The classic problem of any new language.<p>3. Major sponsorship (would greatly help with point 1 &amp; 2)
评论 #27909166 未加载
rishav_sharan将近 4 年前
So I am currently making an api server in Crystal and I adore this language. I would add some pros&#x2F;cons for folks who are interested in trying it out;<p>Pros:<p>- Elegant syntax. Crystal is highly inspired by Ruby and it has a lovely elegant syntax. Syntax is important to me and the clutter of symbols and the busy syntax is why i struggle with Rust.<p>- gorgeous type system. F# is the only other language I can think of which has this lovely and complete a type system. The way Crystal handles Nil (its a type) just feels great in practice.<p>- Perf wise, Crystal is blazing fast. It seems to be marginably faster than most compiled languages like Go, Nim etc in the benchmarks. Though at that level the difference isn&#x27;t much.<p>- batteries included stdlib<p>- decent documentation. It could be better but imo its good enough. I rarely have to look beyond the documentation if I get stuck anywhere.<p>- small but amazing community. the folks in the community like Ali, blacksmoke, Oleh, Ary and many others etc are super helpful and always ready to teach a newcomer.<p>Cons:<p>- Lack of Windows support. The biggest elephant in the room. the good news is that this is under development and even in this release a lot of progress towards a Windows event loop was made. But if you are going to do web dev, you can always go with wsl for the compilation as most of us do.<p>- Slow compilation speed. Its faster than Rust&#x2F;C++ but if you are coming from an interpreted language the 5-10 seconds it takes to compile your small project rankles a bit.<p>- DB drivers need to be better. They currently don&#x27;t support pipelining, ssl, async etc. Not a big deal as the Crystal drivers are performant enough. but I think if these were there, Crystal would get at least 20-30 ranks in the techempower Fortunes benchmarks.<p>- IDE tooling is not yet there.<p>- Small community and hence lack of community packages. Often stuff will have to be done by hand. Things like oauth, openssl conversions etc will need some work from you.<p>- no http&#x2F;2 support<p>- The lack of a BDFL and corporate sponsorship. This means that the language growth is less structured and highly dependent on the community leaders.<p>Here is an old comment I wrote about Crystal on HN. it is still as true today as it was then;<p>----------------------------------<p>I have a love-hate relation with Crystal. Every few months, disenchanted with the core maintainers&#x27; priorities, lack of platform and tooling updates and overall deadland syndromes - I denounce Crystal, promise I will never use it again, startup a golang or Rust project, make some non trivial toy stuff and then come crawling back to Crystal. I hate the fact that I love this language and the fact that nothing else (except perhaps f# and nim) seems to have the same effect on me.<p>My favorites Crystal features are its do-end syntax, dat sexy type system hnnnnghhh... , domain modelling using sum types, null checking using types, ultra simple OOPs, insanely productive std and its sheer performance.<p>The bits about the language I detest are the overuse of macros, the utter lack of any platform (windows, http&#x2F;2 etc.) or tooling improvements (IDE support, slow compilation). The core maintainers are amazing but have a weird obsession with just refactoring the language semantics. Things which really would matter for any language usage are just relegated to GH issues which haven&#x27;t had any comments on it for months (if not years).<p>The lack of a BDFL and corporate sponsorship really hurts Crystal bad. Its a language without directed growth. For a language which seems to be used the most for web servers, it lacks http&#x2F;2, db pipelining and async db drivers. There have been plans for redoing the http module for years but it hasn&#x27;t been done yet.<p>Yet, I love this language despite all its shortcomings. I find it to be one of the most readable languages out there. The community is full of amazing individuals who are ever helpful and welcoming. The core maintainers are super talented developers who really value quality of code.<p>Right now I am working on an api servers and have 3 early implementations - one in Rust-actix, one in pure crystal (no framework) and one in Go-Fiber. The joy of using Crystal and feeling like I am in control of the project are reasons which are pushing me towards using Crystal for the project. But I know that by the next few years, we likely still wouldn&#x27;t have http&#x2F;2, async drivers, nice IDE support and many other features that I really need.<p>And so, I will likely have to go with Go. (Rust syntax is just too complex for my taste. And I am not talking about the celebrated borrow checker).<p>I like go.<p>Go is simple.<p>Go is Productive.<p>Go is... just not Crystal.<p>-----------------<p>Epilogue: I did not go with Go. Its error handling and opinionated formatting turned me off so much that I have returned back to crystal. :&#x2F;
评论 #27904658 未加载
评论 #27904669 未加载
评论 #27905444 未加载
评论 #27906264 未加载
评论 #27907397 未加载
评论 #27906690 未加载
dash2将近 4 年前
I noticed at the bottom that they&#x27;re sponsored by Nikola Motor Corp... surprising!
评论 #27904168 未加载
m12k将近 4 年前
Small correction:<p>ae = &#x27;a&#x27;..&#x27;e&#x27;<p>ccae = [&#x27;&lt;&#x27;, *r, &#x27;&gt;&#x27;] # =&gt; [&#x27;&lt;&#x27;, &#x27;a&#x27;, &#x27;b&#x27;, &#x27;c&#x27;, &#x27;d&#x27;, &#x27;e&#x27;, &#x27;&gt;&#x27;]<p>I&#x27;m guessing *r in the second line should have been *ae (or ae in the first line should have been named r)<p>Also<p>&quot;It is new possible&quot; should prpbably have been &quot;It is now possible&quot;
评论 #27903939 未加载
评论 #27906805 未加载
gorgoiler将近 4 年前
Well I never: today I learned about break expressions:<p><pre><code> nine = while 1 do break 9 end puts nine #=&gt; “nine” </code></pre> I love Ruby. I am not sure how I feel about this. It looks useful for the odd thing or two, maybe.
评论 #27904382 未加载
评论 #27904221 未加载