Live data from Hacker News

Crystal 1.0 – What to expect

crystal-lang.org

171–180 of 351 posts

Re: Crystal 1.0 – What to expect

#171
post #5

Really happy to see this go 1.0. Between Crystal and Zig it's nice to see C++/Rust get some competition

Crystal has a GC. I see it as more similar to the likes of Nim, Swift, Java or C#. It's a great language regardless.

Does languages don’t belong together. Java and C# sure. They use sophisticated garbage collectors and target intermediate code.

Nim, Crystal and Swift all compile to native code and is designed for that.

Swift is not a GC language in the normal sense since it uses automatic reference counting. That is fully deterministic and with low latency. There is no stop the world to collect garbage like with Java and C#.

Swift is akin to C++ code with smart pointers.

Re: Crystal 1.0 – What to expect

#172

Earlier quoted context omitted.

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

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.

Re: Crystal 1.0 – What to expect

#173
post #76

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

multithreading 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 c…

Half 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. :-)

Re: Crystal 1.0 – What to expect

#175

Earlier quoted context omitted.

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

Swift is not any more tied to macOS than C# is tied to Windows. Compiler LLVM and everything is open source and cross platform. Not all the libraries but that holds true for C# as well, last time I checked.

Re: Crystal 1.0 – What to expect

#176

Earlier quoted context omitted.

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

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

As an old Ruby fan, you should seriously check out Julia. It had a lot of the same meta programming goodies as Ruby but with performance that often rivals C/C++. Actually I think Julia will frequently pull off being faster. It is crazy how good JIT compilation works today with a language specifically designed designed for it.

Re: Crystal 1.0 – What to expect

#177
post #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.

It seems they're planning for multi (OS) threads soon, but it wasn't able to make it into 1.0

Re: Crystal 1.0 – What to expect

#178

Earlier quoted context omitted.

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

Is static typing really necessary for speed? The fastest JavaScript engines and LuaJIT are closer in speed to Crystal than Crystal is to C. Granted - all these languages are really fast - and unless you're doing something INSANELY performance dependent and you REALLY know what you're doing - I think familiarity trumps all. You're almost certainly going to write faster Crystal code if you're a Crystal expert than you…

No, Julia is not statically typed and will outperform pretty much anything, at least when dealing with numerical code.

Next generation climate models are built with Julia. You would not pick a slow language for such a high performance dependent task.

Re: Crystal 1.0 – What to expect

#179

Earlier quoted context omitted.

Is static typing really necessary for speed? The fastest JavaScript engines and LuaJIT are closer in speed to Crystal than Crystal is to C. Granted - all these languages are really fast - and unless you're doing something INSANELY performance dependent and you REALLY know what you're doing - I think familiarity trumps all. You're almost certainly going to write faster Crystal code if you're a Crystal expert than you…

It's not necessary strictly speaking, but it make things MUCH easier. JS in v8 has 3 (4?) layers of compilers already and each time some type changes at runtime you're taking a hit to go back to the interpreted version while functions jit compile again. There's a crazy amount of engineering effort that has to counteract a missing "this has one parameter and it's either a string or a float" annotation. In practice if…

That is because JS was not built for JIT compilation. With a dynamic language like Julia built for JIT compilation from the very start you get both much simpler and cleaner design and higher performance.

It uses a method JIT so it is deterministic and easy to analyze unlike JavaScript.

You can lookup ahead of time how each function will get compiled with given input types.

Re: Crystal 1.0 – What to expect

#180

Earlier quoted context omitted.

All of those points are already met and in a better way by mature languages like e.g Kotlin. Really the only argument would be the "Ruby elegance" (or familiarity?) which I don't know. What make ruby/crystal more "elegant" (I would prefer the term readable ) than the competition?

Why Kotlin when you got Swift is an equally valid point. People like choice and for a lot of us, running on the JVM is a non starter. Try creating a small command line tool for a JVM language. You need to distribute a virtual machine with it. You got the overhead of firing up a VM or JIT just for a short lived session. Also JVM gobbles memory. You would not want a system made up of lots of tiny command line tools all…

kotlin/native doesnt require jvm

swift support for windows is non-existent

Post reply on HN