28 ms·
Crystal 1.0 – What to expect
- revskill 6y agoWaiting for Crystal On React (not Rails)
- Trasmatta 6y agoThere are a few web frameworks for Crystal, so you could easily add React to one of those for the frontend
- nlh 6y agoI'm a huge Crystal fan and spoke at the first user conference recently about my project which is almost what you're asking for: https://nlh.me/projects/celestite https://nlh.me/projects/celestite It's a way to tightly integrate Crystal + Svelte, including server-side rendering and the ability to write your frontend purely from components. Not React (yet), but it's heading in that direction...
- brigandish 6y agoThere's always https://mint-lang.com https://mint-lang.com that's more Svelte like, built on Crystal.
- owaisin 6y agohttps://youtu.be/uFr6R8E03UQ https://youtu.be/uFr6R8E03UQ
- mfkp 6y agoLink to the direct release changenotes: https://github.com/crystal-lang/crystal/releases/tag/1.0.0 https://github.com/crystal-lang/crystal/releases/tag/1.0.0
- ibraheemdev 6y agoIt feels like Crystal it took all the best things from the languages I love, and put them together into one, beautiful language: - Elegance of Ruby - Statically type checked + global type inference - No Nulls - Go-like concurrency - Easy C ffi - High performance I really hope the Crystal succeeds and the language goes mainstream - this release is a huge step forward towards that. Congrats to the Crystal team for reaching the 1.0 milestone!
- amir734jj 6y agoVery well said. Elegance of ruby I think is very important for ruby developers who need a performant typed language.
- vinceguidry 6y agoWhy would rubyists need elegance in a different language for perf? Do what everyone else does, and write a C extension.
- Cort3z 6y agoThe point is that they / we don't want to write c.
- vinceguidry 6y agoSpeaking personally, I don't want to write in anything else but Ruby. If I have to code in something else, well, anything's fine. I don't want "elegance" in that language. I don't need other languages to try to be Ruby. I already have Ruby. I just want to get it done so I can build on that work... in Ruby. I just don't understand why other people seem to think Ruby isn't enough.
- straight-shoota 6y agoI like Ruby, too. But Crystal is like Ruby, and better in many regards. Performance is a huge issue with any computational intensive tasks. Crystal's static typing also avoids many simple errors you would only catch in Ruby with an extensive spec suite for many edge cases.
- vinceguidry 6y agoThis is a Crystal discussion, and I hate it when Crystal people show up in Ruby discussions and talk crap about Ruby so I won't argue against you, other than to say that Crystal is only like Ruby in that it's syntax is superficially similar.
- tomc1985 6y agoReally happy to see this go 1.0. Between Crystal and Zig it's nice to see C++/Rust get some competition
- genuine_smiles 6y agoWould a developer looking a Zig/C++/Rust really also consider Crystal? I figured Crystal was for Ruby developers who want a good static type system.
- Doctor_Fegg 6y agoCrystal's appeal, for me at least, is the productivity of Ruby with the memory efficiency and execution speed of C++. Static typing is just a way of achieving that, it's not something I'm seeking per se.
- straight-shoota 6y agoRemember static typing is also really useful for code quality and avoiding hidden bugs. Some code in Ruby requires a ton of specs to discover bugs caused by type issues, while the Crystal compiler tells you immediately that something doesn't work out. I love Crystal's type system really for productivity reasons.
- sjwright 6y agoI haven’t ever understood the argument against static typing. I’ve never declared a variable and not simultaneously thought “this is going to be a float, always a float, never not a float.” The only exception to this is untrusted input, but for that an string is usually always fine.
- pansa2 6y ago> I’ve never declared a variable and not simultaneously thought “this is going to be a float, always a float, never not a float.” Never written generic/template code? Making that much easier is one of the main benefits of dynamic typing.
- cl0ne 6y agoCongrats to the team! I've been trying out Crystal and Amber recently and have really enjoyed using it.
- jug 6y agoThanks for mentioning Amber! I assume it's this project: https://amber-lang.net/ https://amber-lang.net/ I've long wanted to get into Smalltalk and this looks like a very nice, modern way of doing so.
- robrtsql 6y agoI think they meant this web framework: https://amberframework.org/ https://amberframework.org/ There are two pretty big web frameworks in the Crystal world right now, one is Kemal which strives to be the Sinatra or Flask of the Crystal world (lightweight, supporting plugins), and the other is Crystal which is trying to be the Ruby on Rails or Django of the Crystal world (full-featured, opinionated).
- mfkp 6y agoThe other main one is https://luckyframework.org/ https://luckyframework.org/ (also going for more of a full-featured Rails type framework)
- blacksmoke16 6y agoThere are also other options: https://github.com/veelenga/awesome-crystal#web-frameworks https://github.com/veelenga/awesome-crystal#web-frameworks. https://athenaframework.org https://athenaframework.org is pretty unique. It's one of the more flexible frameworks IMO. It was inspired by Symfony and Spring, so takes a bit of a different approach as most other frameworks come from a more Ruby background.
- terracatta 6y agoI love the idea of Crystal but I remember reading that compilation times can balloon very quickly for moderately sized apps. Can anyone who writes Crystal today dispel or confirm that information? I imagine the inferred typing makes building a fast compiler really tough.
- chrisseaton 6y agoWas that possibly before they backed off from global type inference? I think that was the cause of long compilation times. They require you to annotate a few types manually now which is an effective cut.
- astrowilson 6y agoThey haven’t backed off from global inference. They did move to require you to type collections, but methods are not inferred at definition but rather at invocation and it happens globally. There is no solution really. If you want a language to feel like it is dynamically typed but actually has types, something gotta give, and in this case it is compilation times. And it gets quite high fast.
- chrisseaton 6y ago> They haven’t backed off from global inference. You might know a lot more than me about the subject, so feel free to correct me, but I think it used to be truly global inference - as in you were expected to write the whole program with no annotations. But now you're required to annotate instance and class variable types, because compile times were becoming intractable.
- astrowilson 6y agoIt is still global. Typing collections and instance/class variables help, you can optionally type methods, but anything that is not explicitly typed is going to be inferred during invocation and that needs to happen based on all callers in the whole program. Reducing the amount of type variables do not eliminate the global behavior. In contrast, local inference considers a predefined context, such as the current module or class, and is much faster, easier to cache, etc.
- antattack 6y agoNim vs Crystal is an interesting read if not to just compare syntax (three articles span 3 years so I wonder how much has changed since): https://framework.embarklabs.io/news/2019/11/18/nim-vs-crystal-part-1-performance-interoperability/index.html https://framework.embarklabs.io/news/2019/11/18/nim-vs-cryst...
- gpanders 6y agoI hadn't heard of Crystal before reading the OP, but I agree that Nim seems like the most apt comparison as far as new-ish languages go.
- noisy_boy 6y agoI tried to re-run the json parsing test mentioned in the article using latest stable version for both (not super scientific but just compiling the same code using same command and running the binary against the same json ). Crystal completed the task in 2.1s~ vs 3.71s~ for Nim (the timings were quite stable across multiple executions). So seems like atleast for this test, Crystal continues to be quicker.
- cb321 6y agoThat json test gets a lot of attention but A) large scale floating point IO is a terrible application of json (if for no other reason than that float parsing is slow) and B) this mostly measures construction of a big object graph, not json parsing, and so is a poorly isolated test. A better Nim impl would use `parsejson` directly at which point its speed can approach the fastest of any impl. [1] Also, it is implementions (like stdlib) that are assessed not the speed of the language. There are like 10 json parsers beyond the stdlib. No idea about Crystal ecosystem diversity... EDIT: Also, I just ran the base64 encode/decode and with `crystal build --release b64.cr` vs. `nim c --gc:markAndSweep -d:danger --cc:gcc --passC:-flto b64`, the Nim ran twice as fast not half as fast. Anyway, people should not draw conclusions like "Crystal is faster than Nim" from things like this. [1] https://forum.nim-lang.org/t/6920 https://forum.nim-lang.org/t/6920
- neolog 6y agoHow does it compare to Nim?
- machineko 6y agoNim is more mature and a with a lot bigger community with diffrent focus. Crystal focus is pure web trying to be Ruby and Nim is more like python.
- shirleyquirk 6y agosimilar clarity and elegance of expression (crystal is a bit more beautiful i think) both use significant whitespace nim has better cross-platform and embedded support, as crystal targets llvm while nim targets c/c++/js nim has more low-level support with the tradeoff of supporting dangerous things like raw pointers crystal has better async imho
- rishav_sharan 6y agoSyntax wise: Nim is to python what Crystal is to Ruby capability wise both are incredibly powerful genral purpose languages For system language use, Nim is a better choice as you can use it with its Arc GC or no GC at all. Perf wise, Crystal seems to be marginably faster in most benchmarks. Though at that level the difference isn't much. crossplat wise, Crystal has no windows support while Nim has. Tooling wise; crystal IDE tools are pretty far behind that of Nim. Personally I like Crystal a lot due to its type system and syntax but you can't go wrong with either language.
- sergiotapia 6y agoI've used both for medium sized projects. Nim was a better fit for me because: - More mature tools and 'beaten paths'. - much faster compilation times - much better cross platform support - more people I can reach out to for help, amazing Discord server - simple concurrency for my needs - tiny binaries - low memory usage - simple to understand import system. (i hated ruby's import system)
- kureikain 6y agoAnyone want to try out Crystal and not familiar with a static type system, please don't let that discourage you. Crystal type infering is really good to the point you go pretty far without any manually type def. To me, dealing with JSON is always a challenge in truly static type language. Crystal solved it very nicely https://crystal-lang.org/api/1.0.0/JSON/Serializable.html https://crystal-lang.org/api/1.0.0/JSON/Serializable.html
- woodruffw 6y agoCongratulations to the Crystal team. I've been following Crystal's development since around 2016, and it's been a long journey for a large group of incredibly dedicated contributors. One step closer to a world of static, Ruby-like expressivity!
- yellowapple 6y agoExciting news. Windows and multithreading are still showstoppers for me, unfortunately, but with the progress over the last couple years I'm hopeful that there's a light at the end of the tunnel on those fronts, especially now that the language itself is (ostensibly) stable.
- rienko 6y agomultithreading is working with the -Dpreview_mt option, it's decent if the units of work are large enough at least 0,01ms, otherwise the channel overhead will dominate. I find the API nice and easy specially for those familiar with CSP or go. Performance should improve once it gets the necessary love for it to be released to be on by default. Windows requires a lot of boring work, especially considering most of the core devs use Linux / MacOS. Once they make it as priority it should be doable within a few months of work.
- ternaryoperator 6y agoHalf of all devs work on Windows platforms, so IMHO, if the team wants the kind of traction needed to reach for Crystal to reach a self-sustaining level, this should be a high-priority task. Note that all of Crystal's competitors give first-class support to Windows: go, zig, nim, ruby, etc. I say this as a suggestion, rather than a critique. Actually, as a hopeful suggestion. :-)
- yellowapple 6y agoFurther: I'm in the other half of developers, but if I'm going to use Crystal to develop desktop applications (which I'd like to do - particularly games, because that'd be a nice change of pace from business software), it'd be nice to be able to support the platform that - for better or worse - the vast majority of desktop users use.
- filleduchaos 6y agoIt's worth noting that Ruby's support for Windows could not be described as first class for a long time. And that was in a world without WSL. There's sense in just releasing for nix platforms if you have them ready to go, especially when you expect your initial target market to be deploying on nix systems.
- joshlk 6y agoLove the idea... could someone do a similar idea with Python.
- freediver 6y agoReally excited for Crystal. We embarked on a huge project (search engine) using Crystal a year ago after also considering Rust. We have been very satisfied with the exceptional performance, language capabilities and the community.
- geordee 6y agoCongratulations
- johnfn 6y agoHuh - what's the last language that got mainstream adoption without backing from a large company? It almost seems impossible these days. Ruby?
- liveduo 6y agoCompanies love opportunities for sponsorship to get promotion (and status) back. That means unless ideologically opposed almost all small open-source projects will get a larger company to backed them up. I think there are more direction and governance issues than financial.
- Trasmatta 6y agoCrystal has been getting at least some funding from various companies. Maybe not what you would consider a large one, though.
- StefanKarpinski 6y agoJulia
- pjmlp 6y agoIt got MIT backing, no?
- forgotpwd16 6y agoBut then you've to consider that many languages have been created in academic institutions, few have become semi-popular, fewer have entered the industry sector.
- pjmlp 6y agoDepends in what context, a language created by MIT researchers with the goal of changing the status quo of Python and R, followed by the creation of a foundation to drive its adoption among commercial entities, is quite different than the thousands of programming languages created across the globe for yet another compiler class assignment.
- vasilakisfil 6y agoCrystal is a beautiful language, however compiling times is something that put off most people who try it. How comes and they don't allow you to optionally provide types in your function/class signatures so you can help the compiler and speed up the whole process ? I mean global type inference is nice, but giving the option to specify types and speeding up the compiling time would be even more nice.
- colesantiago 6y agoRust also has a very slow compiler but I also see ex-rubyists using it?
- vasilakisfil 6y agocrystal is much slower on compiles
- colesantiago 6y agoIs there any hard evidence for this, seems alright for rust to be slow and people still using it.
- galaxyLogic 6y ago> the option to specify types I think that would be good no only to reduce compile times but also to make code more readable
- brigandish 6y ago> How comes and they don't allow you to optionally provide types in your function/class signatures Perhaps you mean something else, but this is from the book Programming Crystal: > Returning Values > A method returns the value of its last expression, so there’s no need to explicitly return that or declare its type. However, if you want to document or directly control that return type, you can explicitly specify the type, as in this example: > methods_and_procs/methods.cr def typed_method : Array(Int32) (42..47).to_a.select { |n| n % 4 == 0 } end typed_method # => [44]
- denysvitali 6y agoI really need to give Crystal another try. It was a very good language 2-3 years ago, but it was not "production ready" and had a lot of breaking changes. I'm glad to see it reaching such a nice milestone, I'll definitely give it another try and hopefully fall in love with it again :)
- unixhero 6y agoWhoa. I will try it now. Finally it is ready for prime time:) Plugging this great howto video, which I didn't make https://youtu.be/DxFP-Wjqtsc https://youtu.be/DxFP-Wjqtsc
- dkarras 6y agoI think any new programming language should have a "why?" section on their page. I mean obviously this language is serving a need, but what is it? In any case, congrats! I like the features and would like to give it a try some day. I'm still curious about the motivations of this particular language though. Anyone more familiar care to elaborate a bit? Edit: Ok, looks like there is a "why" section on github!
- mathgladiator 6y agoI started this with my documentation because I am still convincing myself that it is a good idea. http://www.adama-lang.org/docs/why-the-origin-story http://www.adama-lang.org/docs/why-the-origin-story
- syspec 6y agoWhich is exactly why you shouldn't do worry about why until later.
- mathgladiator 6y agoI'd argue it's vital to front-load the why question; before you can lead an effort you must believe yourself. The importance of asking why is that you validate whether a project is some ego trip or a legitimate finding worth pursuing.
- Trasmatta 6y agoThey "why" is basically having a language with the aesthetics and usability of Ruby, but fully statically typed with global type inference, and impressive performance. The downside being a relatively slow compiler. It's the necessary trade-off for the type inference.
- elviejo 6y agothank you! this summary is enough for me to try it!
- deleted 6y ago
- dang 6y agoIf curious, here are the significant past threads I found. Others? An Introduction to Crystal - https://news.ycombinator.com/item?id=26217013 https://news.ycombinator.com/item?id=26217013 - Feb 2021 (39 comments) Switch from Ruby to Crystal - https://news.ycombinator.com/item?id=25005780 https://news.ycombinator.com/item?id=25005780 - Nov 2020 (35 comments) Go vs. Crystal Performance - https://news.ycombinator.com/item?id=23615303 https://news.ycombinator.com/item?id=23615303 - June 2020 (160 comments) Ruby vs. Crystal Performance - https://news.ycombinator.com/item?id=23431941 https://news.ycombinator.com/item?id=23431941 - June 2020 (148 comments) Crystal 0.34 - https://news.ycombinator.com/item?id=22800139 https://news.ycombinator.com/item?id=22800139 - April 2020 (31 comments) Towards Crystal 1.0 - https://news.ycombinator.com/item?id=22725829 https://news.ycombinator.com/item?id=22725829 - March 2020 (32 comments) Crystal 0.33 - https://news.ycombinator.com/item?id=22331005 https://news.ycombinator.com/item?id=22331005 - Feb 2020 (42 comments) Nim vs. Crystal - https://news.ycombinator.com/item?id=21883882 https://news.ycombinator.com/item?id=21883882 - Dec 2019 (147 comments) Lilith: x86-64 OS written in Crystal - https://news.ycombinator.com/item?id=21860713 https://news.ycombinator.com/item?id=21860713 - Dec 2019 (251 comments) Crystal 0.31 - https://news.ycombinator.com/item?id=21053366 https://news.ycombinator.com/item?id=21053366 - Sept 2019 (15 comments) Parallelism in Crystal - https://news.ycombinator.com/item?id=20897029 https://news.ycombinator.com/item?id=20897029 - Sept 2019 (41 comments) Crystal 0.29 - https://news.ycombinator.com/item?id=20110253 https://news.ycombinator.com/item?id=20110253 - June 2019 (7 comments) Crystal 0.28.0 Released - https://news.ycombinator.com/item?id=19694006 https://news.ycombinator.com/item?id=19694006 - April 2019 (30 comments) Crystal 0.27.0 released - https://news.ycombinator.com/item?id=18370498 https://news.ycombinator.com/item?id=18370498 - Nov 2018 (36 comments) Crystal 0.26.0 released - https://news.ycombinator.com/item?id=17753367 https://news.ycombinator.com/item?id=17753367 - Aug 2018 (40 comments) Crystal 0.25.1 released - https://news.ycombinator.com/item?id=17424639 https://news.ycombinator.com/item?id=17424639 - June 2018 (152 comments) Crystal 0.25 - https://news.ycombinator.com/item?id=17319689 https://news.ycombinator.com/item?id=17319689 - June 2018 (68 comments) Why Crystal Is My Next Language - https://news.ycombinator.com/item?id=17280969 https://news.ycombinator.com/item?id=17280969 - June 2018 (192 comments) The Crystal Programming Language - https://news.ycombinator.com/item?id=16842442 https://news.ycombinator.com/item?id=16842442 - April 2018 (73 comments) Why I'm excited about Crystal in 2018 - https://news.ycombinator.com/item?id=16221053 https://news.ycombinator.com/item?id=16221053 - Jan 2018 (7 comments) Crystal 0.24.1 released - https://news.ycombinator.com/item?id=16021965 https://news.ycombinator.com/item?id=16021965 - Dec 2017 (22 comments) Overview of the Crystal language - https://news.ycombinator.com/item?id=15945262 https://news.ycombinator.com/item?id=15945262 - Dec 2017 (90 comments) Crystal in Production: Diploid - https://news.ycombinator.com/item?id=15574714 https://news.ycombinator.com/item?id=15574714 - Oct 2017 (120 comments) Journey from Node to Crystal - https://news.ycombinator.com/item?id=15240984 https://news.ycombinator.com/item?id=15240984 - Sept 2017 (6 comments) Crystal Lang vs. Node.js vs. Go Benchmarks - https://news.ycombinator.com/item?id=14368050 https://news.ycombinator.com/item?id=14368050 - May 2017 (10 comments) From Ruby to Crystal: A Quick Look - https://news.ycombinator.com/item?id=13949353 https://news.ycombinator.com/item?id=13949353 - March 2017 (43 comments) Building a Command-Line Application with Crystal - https://news.ycombinator.com/item?id=13945591 https://news.ycombinator.com/item?id=13945591 - March 2017 (33 comments) Porting Ruby to Crystal - https://news.ycombinator.com/item?id=13837109 https://news.ycombinator.com/item?id=13837109 - March 2017 (34 comments) A new year resolution to have Crystal reach the 1.0 milestone in 2017 - https://news.ycombinator.com/item?id=13281333 https://news.ycombinator.com/item?id=13281333 - Dec 2016 (78 comments) The Crystal Programming Language - https://news.ycombinator.com/item?id=13209575 https://news.ycombinator.com/item?id=13209575 - Dec 2016 (193 comments) Crystal: Fast as C, Slick as Ruby - https://news.ycombinator.com/item?id=12223395 https://news.ycombinator.com/item?id=12223395 - Aug 2016 (429 comments) Kemal: Fast, simple web framework for Crystal - https://news.ycombinator.com/item?id=11143811 https://news.ycombinator.com/item?id=11143811 - Feb 2016 (16 comments) The future of the Crystal language - https://news.ycombinator.com/item?id=10803635 https://news.ycombinator.com/item?id=10803635 - Dec 2015 (36 comments) Crystal-Lang – Beauty of Ruby, Faster Than Go - https://news.ycombinator.com/item?id=10014178 https://news.ycombinator.com/item?id=10014178 - Aug 2015 (31 comments) Amethyst – Rails inspired web-framework for Crystal language - https://news.ycombinator.com/item?id=9716508 https://news.ycombinator.com/item?id=9716508 - June 2015 (8 comments) Crystal Language - https://news.ycombinator.com/item?id=9669166 https://news.ycombinator.com/item?id=9669166 - June 2015 (171 comments) Crystal: the programming language - https://news.ycombinator.com/item?id=8658358 https://news.ycombinator.com/item?id=8658358 - Nov 2014 (51 comments) Meet Crystal language in its birthday. It is compiled and has ruby like syntax - https://news.ycombinator.com/item?id=6342609 https://news.ycombinator.com/item?id=6342609 - Sept 2013 (84 comments)
- samuell 6y agoCongrats on the release! The biggest factor drawing me to experiment a little with Crystal is that it is one of very few languages providing what otherwise has been pretty unique to Go: Lightweight threads+Channels+M:N concurrency (automatically multiplexing the lightweight threads onto a smaller number of OS threads). Also it does it with a very readable and clean syntax. Wrote a little about it, with code comparisons, before: https://rillabs.com/posts/crystal-concurrency-easier-syntax-than-golang https://rillabs.com/posts/crystal-concurrency-easier-syntax-...
- The_rationalist 6y agoThe biggest factor drawing me to experiment a little with Crystal is that it is one of very few languages providing what otherwise has been pretty unique to Go: Lightweight threads+Channels+M:N concurrency This has no value proposition versus Kotlin coroutines and if it doesn't have first class support for structured concurrency, cancelation and most importantly reactive streams then this language is sub-par.
- adenozine 6y agoHave you ever thought about why so many of your comments get downvoted?
- The_rationalist 6y agoThe conflict between mental expectations / wishful thinking of people reading me and the sounds, grounded in truth arguments that I provide likely hurt some feelings and thus is downvoted. Platforms like HN definitely lack truth seekers like me that make online conversations more epistemologically valid, especially in this post truth era. Do you realize the human resources cost that a new language imply? A new programming language (which is not polyglot aka based on graalvm) imply an almost complete duplication of work for creating their library ecosystem instead of reusing the existings. We talk about so many human hours wasted that could have instead be used for making the world a better place. Justifying such a cost is already almost impossible with a language that has a clear value proposition but to not realize the absurdness of this cost for a language that has no clear value proposition really is something intellectually...
- maattdd 6y agoCrystal is one of my most productive language for small project web oriented (Slack bot): a cleanup Ruby with added benefits (performance, type safety, null safety, proper concurrency). My only complaints: * compilation speed * type inference is sometimes not intuitive (class members * too OOP oriented (no constness, no UFCS/pipeline, no general monad operator,...etc)
- kickscondor 6y agoI'm new to Crystal - have been using it the past three months on a new web API. (I'm using the Lucky framework - https://luckyframework.org/ https://luckyframework.org/) It's fantastic. I can think in it. Thank you to all the devs behind this wonderful language!
- acmecorps 6y agoI’m very interested in migrating a production rails apps to crystal / lucky. Was your previous exp using rails?
- kickscondor 6y agoA bit - mostly Sinatra and Grape tho. Migration seems like it might be tough. The ORM (Avram) is missing some things still. (Like I think - tables without primary keys, seems like 'has many through' needs some work, stuff like that.) My API is quite simple.
- bovermyer 6y agoI've been waiting for this. I played around with Crystal earlier in its development, and even threw some money the devs' way to help with costs. Now I'm going to spend time writing something non-trivial in Crystal. Very excited!
- macawfish 6y agotldr: crystal is awesome! I tried crystal recently to dump some data from a GraphQL endpoint into Redisgraph. I had done the same with Rust, but string manipulation was much simpler in Crystal (the string interpolation is amazing!) so it was much simpler to quickly throw together the queries I needed. I think for me, rust is something I'd use for building a solid library, whereas Crystal would serve more as an alternative to Go, something more for quickly assembling some building blocks into applications or doing glue stuff with decent performance.
- weatherlight 6y agoThis is very exciting :) I've used Crystal for a bunch of toy projects, it's been a pleasure to use so far, Congrats to the Crystal team!
- adgezaza 6y agoThe world doesn't need more OOP, please.
- lights0123 6y agoThe logo on the top right should be a link to the homepage, not a rotateable 3D model. Or if it is, it should still be a link when you don't rotate it.
- mrbonner 6y agoYou know, I have been language-hopping for over a year now, in hope to find a secondary language I could learn beside the bread-winner Java. Trying to strike the balance between productivity and performance is pretty hard. I tried Go, it looks ugly (sorry). I tried Rust: it is beautiful in concept but I don't feel productive enough. I mean, maybe my use case is not align with Rust. My secondary lang should allow me to do more exploration in data analysis and not system programming. I looked and Nim/Zig and something else in between like Lua and Python (for the 4 times in 4 years I think). Nim is nice but the ecosystem is not there. Zig is also sys-programming focus. Python ecosystem is huge but I just don't feel like the perf is a killer. What I really love about Python is the list comprehension, i.e a_list = [(Ababa) for a in 1..100 for b in 'a'..'z'] for example. Until I found Julia, everything else is history. It seems to have everything I have asked for and more. Albeit that the precompile time is abysmal but I know I could use the sysiamge hack-around. I think I'd stick and be content with Julia! With VS Code's Julia extension plus the remote (SSH) development, I could do many "cool" things people do in Python except maybe more performant :-)
- socialdemocrat 6y agoIt is cool to have options. I do actually like Go, but Julia is my favorite. Still a bit surprised that Julia is almost never mentioned in Crystal discussions. If you love Ruby, and want something with higher performance, then Julia is a pretty natural next step. Sure it does not have the same syntax. Maybe I am just getting old but when Ruby came out, that was cutting edge. It was a fresh new way of writing code. I had all the cool stuff. I you want that same kind of feeling today, where you got super awesome modern features, meta-programming galore, functional programming, you name it, then Julia is it. Julia is the new Ruby. Sure Ruby is a very object-oriented language and Julia is more functional, but that is where the industry has been heading these last years. And Julia is a pragmatic version of functional programming which I think most people can easily become accustomed to.
- dleslie 6y agoIf it doesn't have first-class windows support or multithreading then I can't be bothered, sorry. I'd prefer it be a gcc frontend, too, to gain access to all the interesting targets that gcc supports and llvm doesn't.
- connorlay 6y agoCongratulations to the Crystal team! I know many Rubyists who would love to write a language with the runtime benefits of Go, but values and design principles of Ruby. For those looking to get into a young ecosystem, Crystal looks like a great option. As for other Ruby alternatives, I moved from Ruby to Elixir a few years ago. Immutable data and OTP more than make up for the language's lack of static typing in my mind. There is also Gleam, which I'm watching for now. One of these days I'll dig into Rust, which fills a similar niche that Crystal would.
- maxpert 6y agoCrystal has been my language for my passion project (https://gitlab.com/maxpert/crlocator https://gitlab.com/maxpert/crlocator). I can tell you the speed and magical ruby syntax is unbelievably good (not for everyone’s taste). I just wish a better IDE support now. Since I’ve used Kotlin I’ve been spoiled by the IDE. But I assume it should be relatively straightforward because it’s all static typed.
- rafaelvasco 6y agoLooks very fast to type. The faster I can code anything in a programming language, the better, if it looks clean. Which it does.
- deleted 6y ago[deleted]
- rguiscard 6y agoI hope they offer aarch64 version in tier 1. Otherwise, it is not easy to cross compile for Raspberry Pi.
- mavu 6y agoIt's possible to have the compiler running on raspbian. I did that with an older version, (not tested with current, but i guess it should still be possible) and it works nicely. I found that easier than constant crosscompiling.
- G4BB3R 6y agoI've used Crystal before, I liked a lot except the compilation time. I am excited to try it again, download Crystal + Lucky framework, but seems shards are not updated to 1.0 yet. I'll wait a few weeks before trying again.
- rienko 6y agoIf you do a 'shards install --ignore-crystal-version', it should mostly work. There aren't many breaking changes from v0.36.1.
- mlindner 6y agoI don't know much about Crystal, is it basically just a better/faster Ruby that's statically compiled instead of run through an interpreter? I just skimmed the Wiki page on it.
- kiawe_fire 6y agoRuby was one of the languages I "cut my teeth" with to some extent, and I've always loved it's syntax and guiding philosophies, but was pulled away to PHP for my job, and ended up using other things for side projects. So a project that compiles to native code but uses Ruby-like syntax is very much "what I would build if I committed to building a language". But I've kept pushing off learning it on the notion that I could always justify learning other things that were "version 1" and "production ready (whatever that means)". I'm thinking now is the time to jump in and try this out finally. Any real world users care to explain some domains that either are or are not well suited for this at the moment? Any "gotchas" with writing C-bindings, should I need to? Or is the library ecosystem fairly strong?
- rienko 6y agoIt's very good for CLI apps, and quick one programs, web dev is decent Lucky is an awesome framework, the compile times make the code-compile-reload cycle subpar, specially if you compare it to scripting languages. Performance is normally excellent but the GC is suboptimal for some workflows, it's not yet written in crystal and it's too conservative recouping memory. The nicest side effect of crystal is that it's programs are far more likely to work on first compiles than ruby scripts, and the type system makes refactoring a large code base much safer.
- waylandsmithers 6y agoPersonally I was surprised to see that Thoughtbot (a top web/mobile app consultancy and creator of factorybot and other well known open source libs) starting publishing blog posts detailing use of Crystal for some of its client projects. To me this was a sign that it should be taken seriously as an option for web development.
- stewbrew 6y agoCan the crystal compiler create shared libraries, which I can access from other languages, e.g., python, R etc.?
- maattdd 6y agoUnfortunately no, it need some runtime (libevent, boehm gc) which is hard (impossible?) to integrate inside a shared lib.
- filleduchaos 6y agoIs this based on experience or just speculation? I have used Crystal to create shared libraries which I've called from various other languages (JS, Dart, Ruby, even C) and it worked well enough.
- maattdd 6y agoIt's possible, just not officially supported nor straightforward. You need to run the GC yourself and all this kind of stuff. https://stackoverflow.com/questions/32916684/can-a-crystal-library-be-statically-linked-to-from-c https://stackoverflow.com/questions/32916684/can-a-crystal-l... https://gist.github.com/Papierkorb/02d6ba53c28b5035a80bf7695f4706bb https://gist.github.com/Papierkorb/02d6ba53c28b5035a80bf7695...
- filleduchaos 6y agoIt's not officially supported yes but having actually done it multiple times for multiple projects I don't see how it's not straightforward. - You do the linking yourself, so that you can pass the flags to produce the kind of library you want. This is something the Crystal compiler helps with (it spits out the LDFLAGS that you need). - Calling `GC.init` when your library is loaded if you want to use garbage collection seems a bit obvious in its necessity. Using `GC.free` to free memory that has gone beyond Crystal boundaries follows naturally (and most libraries have custom `free_*` functions to clean up complex objects). The main complexity you have to write a C-friendly API for the library, but that's something that you have to do with C++ and so on as well
- Balduran 6y agoCongratulations on the great effort! Is there any documents or comparatives that can help me selling this language to managers to use this language in a professional setting?
- hit8run 6y agoCongratulations on this release :) A big achievement! I played around with crystal two years ago and really liked the approach. To me it's a nice statically typed Ruby with a simpler "meta"-programming through macros. Decent multi-core support is the next milestone for the project and I'm looking forward to it :) Anyone knows how good the tooling around crystal is nowadays? When I used it for a pet project there was no decent language server and it felt as I was using a notepad. How is https://github.com/elbywan/crystalline https://github.com/elbywan/crystalline or https://github.com/crystal-lang-tools/scry https://github.com/crystal-lang-tools/scry nowadays? Would be cool if every language provided their own language server as part of the base release, I guess.
- dedoussis 6y agoThis is a great thread to plug my favourite crystal streamer: https://www.youtube.com/channel/UCaydNuV-VSO0gFSrvS9WgXg https://www.youtube.com/channel/UCaydNuV-VSO0gFSrvS9WgXg
- BilalBudhani 6y agoThanks for sharing this. Looks like the channel has covered variety of videos on Crystal ecosystem.
- kimburgess 6y agoI knew that would be Lorenzo's channel before opening the link. So many perfectly paced lessons on tremendously useful topics.
- dikaio 6y agoCrystal was first introduced to me a few years ago but it was still in early development I’ll need to revisit it again now that 1.0 has been released. I’m curious as to what others in here feel about pros and cons of learning Nim compared to Crystal?
- undecisive 6y agoI'm in the same boat - looking at them both in quick succession, I chose to back nim because the error messages I got from Crystal were unusable. Now that it is at 1.0, I agree - worth serious reconsideration. That said, it sounds like Nim's concurrency is far more mature than Crystals, and Nim works well on arm etc. So definitely worth another look, but might be a couple more years before I'm able to use it in anger unfortunately.
- exabrial 6y agoI applaud the crystal team. They've taken a lot of good ideas from other languages and left the bad ones. Not an easy task to pull off! I couldn't find this with a casual Google search, but will they be developing a formal language spec? Is love to see a Graal, JVM, or LLVM target for Crystal eventually!
- deleted 6y ago[deleted]
- OOPMan 6y agoAnother day, another programming language release
- vlazar 6y agoThis is huge! Hopefully 1.0 would allow more companies to use it. I've been following the evolution of Crystal for more that 3 years now. I came from Ruby. Got a JSON/nested structures first program in Crystal working without even reading the docs. Was impressed by Crystal being "a cleaner Ruby" (some of the Ruby quirks removed, some nice things added), compile time NULL checks, type inference and of course it's runtime speed. Next I've rewritten a small web service from Ruby to Crystal and seen a huge speedup with API requests serving in microseconds. The pre-import CSV data process (took ~ 40s in Ruby) was replaced by just reading CSV on the fly during server boot (~ 2s). Not even tried to optimize anything, just straightforward "make it work". I would encourage anyone who loves Rube to check Crystal. I would also suggest not to look at Crystal as just faster (fancier) Ruby. Although on the surface it looks very similar it actually quite different.
- transfire 6y agoIt seems like Crystal is essentially the successor to C++, just as Rust or Go seem to be the successor of C.
- maattdd 6y agoI have no idea how you ended up with this completely wrong statement. Rust is closer to C++ replacement, and Crystal and Go are something else (GCed to begin with).
- lfnoise 6y agoAny programming language that has string operations as regular functions or methods that can be used unqualified, but puts math functions into a "Math" namespace so you have to write "Math.sin", has made a decision to prioritize string processing over math. That decision weighs a lot when I consider whether to use a language, since I do mostly math and very little string processing. Smalltalk had math functions as methods with the number as receiver.