Live data from Hacker News

Crystal 0.25.1 released

crystal-lang.org

81–90 of 154 posts

Re: Crystal 0.25.1 released

#81
post #11

Crystal looks interesting although I decided to learn Golang instead. It's more mature and the WIP features described below made me cautious (i.e. what other features are immature). Anyone know when Crystal will get concurrency-a-la-golang? i.e. running concurrent processes in parallel? At the moment I think it's still single-threaded. https://crystal-lang.org/docs/guides/concurrency.html Still no windows support: ht…

I've programmed in both and as far as I can tell here's the best use case for each: Go - I want to program explicitly and don't mind a little extra code or syntax to do it. I want close to the best performance possible and a single distributable binary. I don't mind being encouraged to "roll my own" api / web app rather than using a framework. Crystal - I want to feel like I'm writing in Ruby, but with type checking…

> I don't mind being a little less performant than other compiled languages.

What other languages? Because the language uses "Fast as C" as part of it's tagline. Is this a false claim?

Re: Crystal 0.25.1 released

#82

I tried out Crystal and Kemal a few months ago and really enjoyed it. However, one issue that's preventing me from wanting to take it to production is that apparently you cannot generate fat binaries and run them without Crystal also being installed in your deployed environment. Is that true still? If it is, does anyone know when support for "real" fat binaries (no need for Crystal on the server) will be available?

Do you mean statically linked binaries? Fat binaries generally refer to multiple ABIs in the same image, a mostly Apple thing these days.

I'm referring to fat binaries like the one Golang would compile too. Apologies if I have some terms mixed up here!

Golang produces one single binary you can deploy to your target environment and doesn't really require anything else installed.

From what I've read, Crystal generates a binary but you also need to ensure Crystal is installed on your target environment.

Re: Crystal 0.25.1 released

#83

Crystal is a nice language that just keep getting better. Think about 10 years ago, we never think of a small company,community be able to writing a programming language. Nowsaday Crystal/Elixir/Nim prove what we can without huge financel support from huge company. Crystal pick Ruby syntax, which is very elegant to me and I'm happy to have that option available and appreciate that.

> Think about 10 years ago, we never think of a small company,community be able to writing a programming language.

Perl, python, ruby ?

Re: Crystal 0.25.1 released

#84
post #28
post #6

Earlier quoted context omitted.

I'm not sure why anyone would actually use it in the current state, unstable, lack of libraries, lack of community and the biggest problem no multi-threading / windows support

I know you’re (effectively) trolling here, but there are many reasons to “actually” use it. The community is great and helpful (check out the Gitter activity if you have any question about that). Lack of Windows support (for now) doesn’t matter if....you don’t use Windows. Multi-threading is being worked on. You’re rehashing the same 2 things many folks point out that Crystal is missing in its pre-1.0 state and while…

Ruby is pretty useless on Windows too to be fair.

Good luck trying to compile native libraries.

Re: Crystal 0.25.1 released

#85
post #6

Earlier quoted context omitted.

I'm not sure why anyone would actually use it in the current state, unstable, lack of libraries, lack of community and the biggest problem no multi-threading / windows support

You could basically say the same about any language. Just switch the descriptions. For example: C#: verbose, magical dependency injection, Microsoft, etc. Ruby: slow Go: ugly syntax, verbose, if err != nil, etc. If a language works for you I see no reason not to use it :-)

Ruby's getting much faster now with recent speed improvements, JIT and recent developments by the TruffleRuby team

Re: Crystal 0.25.1 released

#86
post #73

Won't the impending releases of TruffleRuby, Graal and Substrate VM make Crystal irrelevant?

That's about speed (though I think Truffle/Graal make an app consume more memory). Crystal is type-safe, and no optimizing VM can do that for Ruby. Not that type-safety is a killer feature, but that's just one difference.

https://medium.com/byteconf/stripe-is-building-a-ruby-typech...

Stripe are trying to solve that issue.

Re: Crystal 0.25.1 released

#87
post #70

Earlier quoted context omitted.

"make even basic tasks sometimes extraordinarily difficult, or so I've heard" That would be an understatement :-) But it's a trade-off. You fight the borrow-checker to ensure safe code. It's really subjective. Are you using a language for front-end/middle-tier service/back-end process, etc. etc. Back in the day - you had a handful of people writing C code via CGI for web development. Every good language addresses a p…

Exactly. I wouldn't write a kernel or shared library in Crystal and I wouldn't write a webapp in Rust.

> wouldn't write a webapp in Rust

https://rocket.rs looks nice ;)

Re: Crystal 0.25.1 released

#88
post #74

Earlier quoted context omitted.

Interesting! I’m surprised you didn’t move to Elixir given the syntax similarities to Ruby

The syntax similarities between Elixir and Ruby stop as soon as one moves on from reading short blog post to writing real code. They are extremely different languages. Knowing Ruby helps only to remember the names of some standard library modules and functions, which were designed on purpose to match the name of the corresponding Ruby modules and methods, but not all of them. A vanilla example: $ iex > "1 2 3" |> Str…

Kotlin syntax:

"1 2 3".split(' ').map { it.toInt() }

Re: Crystal 0.25.1 released

#89

Earlier quoted context omitted.

Do you mean statically linked binaries? Fat binaries generally refer to multiple ABIs in the same image, a mostly Apple thing these days.

I'm referring to fat binaries like the one Golang would compile too. Apologies if I have some terms mixed up here! Golang produces one single binary you can deploy to your target environment and doesn't really require anything else installed. From what I've read, Crystal generates a binary but you also need to ensure Crystal is installed on your target environment.

Golang makes statically linked binaries. (Well, until you use cgo.)

By default, Crystal generates dynamically linked binaries. You absolutely do not need Crystal to run them. But you do need:

- Boehm GC (libgc-threaded)

- libevent

- PCRE if the program uses regexps

- libyaml if the program uses yaml

- OpenSSL if the program uses crypto/TLS (?)

Here's an example ldd output:

    /usr/local/bin/shards:
            libyaml-0.so.2 => /usr/local/lib/libyaml-0.so.2 (0x8c0bb1e000)
            libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0x8c0bd3c000)
            libm.so.5 => /lib/libm.so.5 (0x8c0bfb8000)
            libgc-threaded.so.1 => /usr/local/lib/libgc-threaded.so.1 (0x8c0c1e6000)
            libthr.so.3 => /lib/libthr.so.3 (0x8c0c444000)
            libevent-2.1.so.6 => /usr/local/lib/libevent-2.1.so.6 (0x8c0c66c000)
            libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x8c0c8c3000)
            libc.so.7 => /lib/libc.so.7 (0x8c0cad2000)
            libdl.so.1 => /usr/lib/libdl.so.1 (0x8c0ce8f000)
            libcrypto.so.42 => /usr/local/lib/libcrypto.so (0x8c0d091000)
You can try `crystal build --static` though :)

Re: Crystal 0.25.1 released

#90
post #24

Earlier quoted context omitted.

How is Ruby an obscure language...? Their developers are already proficient in Ruby. Crystal is a very, very close cousin of Ruby, syntactically and structurally. This isn't like jumping from Java to Haskell.

I didn't know it was that similar. Neat idea for a language. The 'Boo' language does the same for Python.

I'd say Nim is for Python what Crystal is for Ruby.
Post reply on HN