Live data from Hacker News

Crystal 1.0 – What to expect

crystal-lang.org

281–290 of 351 posts

Re: Crystal 1.0 – What to expect

#281

Nim 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-cryst...

I 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.

Re: Crystal 1.0 – What to expect

#282
post #117

Earlier quoted context omitted.

> 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.

It's possible—nay likely—that I don't understand the true value of generics. It's something that I've looked into on occasion and it never seemed all that useful to me. Most examples I've come across in the past were C++ and seemed like formalised workarounds for deficiencies in the C++ type system rather than being actually useful. I'm sure I've failed to grok them—or based on the code I write I'm not the target aud…

Python typecheckers (both pyright and mypy, I believe) do this (isinstance checks and some other checks in conditionals narrow the type on the defended path.)

Re: Crystal 1.0 – What to expect

#283

Earlier quoted context omitted.

Also, it produces binaries (probably similar to golang) which are a reasonable size considering there is a garbage collector. No giant interpretors or VMs required. And macros.

What is the compilation speed like? EDIT: also forgot to ask if Crystal has a "killer app" yet? Ruby had Rails, Python had scipy/pandas(several others), Rust had servo etc.

Yes, there are lucky and amber frameworks. Hopefully, one of them will make crystal more popular/mainstream.

Re: Crystal 1.0 – What to expect

#285

Earlier quoted context omitted.

You can group languages in different ways. VM vs native is one way, but you can also go by the level of abstraction they provide, which very much puts them in the same category. Also, this debate comes up every time, but ARC is widely classified as a form of garbage collection, just not a tracing one. It is transparent and automatic to the user. (Well, apart from cycles)

I disagree with that classification, as there's no "garbage" state for references as they are destroyed immediately. All garbage collecting languages on the other hand have period of time where the references are intact but marked as garbage. FWIW Chris Lattner, the language creator, put Swift into a non-GC camp.

Even in Swift the references are not "destroyed immediately" but because of various performance optimizations this "garbage state removal" is deferred - for example to the end of scope... The truth is, that they >>don't want to call it GC<< for marketing and other reasons... One could implement ARC with cycle collector for Java as well - and it would be just another form of GC... it would use less memory (because garbage would be released faster), but it would be slower...

Re: Crystal 1.0 – What to expect

#286
post #117

Earlier quoted context omitted.

> 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.

It's possible—nay likely—that I don't understand the true value of generics. It's something that I've looked into on occasion and it never seemed all that useful to me. Most examples I've come across in the past were C++ and seemed like formalised workarounds for deficiencies in the C++ type system rather than being actually useful. I'm sure I've failed to grok them—or based on the code I write I'm not the target aud…

The main benefit of generics is to easily maintain strong type information for implementers.

With a

  createMapWithStringKey(T arg) -> Map
You can keep strong type info with

  AType a
  var b = createMapWithStringKey(a)
  // b is for certain a Map

Re: Crystal 1.0 – What to expect

#288

Earlier quoted context omitted.

What is the compilation speed like? EDIT: also forgot to ask if Crystal has a "killer app" yet? Ruby had Rails, Python had scipy/pandas(several others), Rust had servo etc.

Why is that important given Moores law and fast developer workstations? Everyone seems so preoccupied with compile speed for Crystal.

Once you've gotten used to the speed of something like OCaml and Go, it's really hard to go back. Rust feels excruciating to me, even though I like the language.

Re: Crystal 1.0 – What to expect

#289

Earlier quoted context omitted.

Fast compilation times are one of the best things from the languages I love. I’d really love to see OCaml get true parallelism, green threads, and a decent HTTP server story. Then, I don’t think I’d look anywhere else.

Are you saying Crystal has fast compile times or that it doesn't? You seem to be saying that it does, that that is one of the things you love about it but others below are saying it is slow.

It was really slow last time I tried it. I really like Crystal and wish it the best, but it's hard for me to imagine using a sluggish compiler as a daily driver.

Re: Crystal 1.0 – What to expect

#290

Earlier quoted context omitted.

C# ? Not complicated at all. In fact it's currently one of the most cross platform language/runtime in existence after .NET Core appeared, and now more than ever with .NET 5.0. I even managed to AOT compile code and run it without a trace of .NET. Just amazing.

C# is a really good language, but I had nothing but problems trying to develop with it on Linux exclusively. MonoDevelop doesn't support Linux anymore since a bunch of proprietary components were added to it (and this isn't even mentioned on its homepage), so you have to use a community fork. That didn't bode well for me. The fork didn't have packages for my distro and I couldn't get it to compile for two hours. VS C…

Yeah, I tested it on Ubuntu, had no problems. But yeah, VSCode doesn't cut it completely. Rider is as better or better than VS in some regards but it's paid.
Post reply on HN