Live data from Hacker News

Crystal 1.0 – What to expect

crystal-lang.org

111–120 of 351 posts

Re: Crystal 1.0 – What to expect

#111

Earlier quoted context omitted.

Ah! I hadn't thought of those, though I think because 3 out of 4 are tied to a specific platform

I think you mean 1 out of 4? Swift is the only one on that list that really feels tied to any particular platform. C# has been extremely portable for years now thanks to .NET Core. Even SQL Server runs on Linux these days, if you really just enjoy spending money. Java has always had a strong focus on portability, of course. Nim... I don't know much about. Doesn't it compile to C? I don't think it intentionally has an…

C# is tied to .net, and the cross-platform story on that framework is...complicated

Java is tied to JVM

Swift is tied to MacOS.

Of course, with the exception of JVM, they are all nominally "cross-platform" in the OS sense of the word. But I haven't seen any substantial Linux/Mac .Net codebases yet, same with Swift on Windows

Re: Crystal 1.0 – What to expect

#112

It 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 reac…

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.

Re: Crystal 1.0 – What to expect

#113

Earlier quoted context omitted.

Do zig, python, elisp, Clojure, Haskell (mostly a research project), etc fit the bill?

Out of those Pythons the only one that's widely used in production, and it's been around for a long time. Python itself is an extremely simple language, which I think can work as one person passion project. Modern python has grown significantly from its first release in the 90s though. I don't think that can happen today, we all want too much out of our programming languages.

> Python itself is an extremely simple language

Unfortunately that’s not true at all - Python is far from simple. Sure, it’s no C++, but it’s very complex compared to languages like C, Go, Lua, even JavaScript.

Re: Crystal 1.0 – What to expect

#114

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

Re: Crystal 1.0 – What to expect

#115
tldr: 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.

Re: Crystal 1.0 – What to expect

#116
post #55

Congrats 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 compariso…

> automatically multiplexing the lightweight threads onto a smaller number of OS threads

For Crystal 1.0, the number of OS threads is always 1, isn’t it? So although this provides concurrency, it’s less powerful than Go where the same mechanism also provides parallelism.

Re: Crystal 1.0 – What to expect

#117

Earlier quoted context omitted.

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

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

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

Re: Crystal 1.0 – What to expect

#118
post #70

Earlier quoted context omitted.

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

The "downside" you forgot to mention a lot of important things: - tooling is abyssmal ( IDE etc ... ) - no mutli threading - no real support, I'm not even sure if there is one paid guy anymnore on the project - it's still immature - they break the API all the time

Multithreading has been present behind a compiler flag for a solid 7 minor versions (since 2019). The feature is maturing for a release in the 1.0 -> 2.0 range.

Re: Crystal 1.0 – What to expect

#119
post #52

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

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

> The downside being a relatively slow compiler. It's the necessary trade-off for the type inference.

I'm curious about that, MLs usually have fast compilers (OCaml for example) and have type inference. I thought that the slow compilation times were due to LLVM .

Post reply on HN