Live data from Hacker News

Crystal 0.25.1 released

crystal-lang.org

91–100 of 154 posts

Re: Crystal 0.25.1 released

#91

Earlier quoted context omitted.

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 => /us…

Thanks for explaining! In other threads, I've seen people refer to them as fat binaries, but yes, I've also seen them referred to as statically linked binaries.

Re: Crystal 0.25.1 released

#92
post #73

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

Other than being a statically typed language: Crystal AOT compiles down to native code (so, good FFI) and has a much better portability story (you can port it to ~any LLVM target).

All that Graal stuff, while a true open source project, has some "Oracle weirdness" around it (IIRC, only Linux (and probably only amd64) is supported in the "community edition") and requires JDK 9/10 (not available on FreeBSD yet..)

Re: Crystal 0.25.1 released

#93

Earlier quoted context omitted.

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.

That's still not the same as a compile time type-checker, it still relies on the interpreter.

Re: Crystal 0.25.1 released

#94

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?

Not sure when/if this changed recently, but from:

https://crystal-lang.org/docs/using_the_compiler/ "Creating a standalone executable":

crystal build some_program.cr --release --static

Builds a static binary (just tried it on Ubuntu 18.04 with a simple hello-world).

Re: Crystal 0.25.1 released

#95

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?

You can use my alpine docker image to statically compile without any fuss: https://hub.docker.com/r/durosoft/crystal-alpine/

I'll be updating it later today with 0.25.1 support.

You can statically compile a local crystal file using a docker one-liner that is included in the description.

Re: Crystal 0.25.1 released

#96
post #94

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?

Not sure when/if this changed recently, but from: https://crystal-lang.org/docs/using_the_compiler/ "Creating a standalone executable": crystal build some_program.cr --release --static Builds a static binary (just tried it on Ubuntu 18.04 with a simple hello-world).

You're going to have much better luck with an alpine-based docker image. Unfortunately non-musl based systems have a lot of issues with static compilation, so while this will work with hello world, if you try something more complicated you will likely get linker errors.

Re: Crystal 0.25.1 released

#97
post #60

Earlier quoted context omitted.

Our ~100k line web app takes 10-15 seconds to compile.

~100k LOC in Crystal? that's pretty amazing

about 60-70k of that is slang, CSS, and frontend javascript, but we're still looking at a large amount of pure crystal.

Re: Crystal 0.25.1 released

#98
I gave up on crystal and realized I should've started with rust in the first place.

Crystal wants very badly to displace ruby, in order to leverage the network of developers and generate more and more attention. It's a smart decision on their part.

As such, crystal doesn't seem to have munch interest in low-level nitty gritty. "we aren't trying to be C" is a common comment amongst contributors.

For game dev, (why I'm bothering with rust) it's too big a turn off to ignore.

For web dev, I suspect crystal will ultimately find some success. Lucky framework has some REALLY cool features that rails hackers are going to discover eventually.

Unless ruby 3 drops a type system bomb and finds a 10x perf speedup, the continuing progress crystal is making will consume the ruby ecosystem.

Congrats on another successful release! Still no exhausting matched, no parallelism, and the spectre of type system changes in the future still looms, but aside from those things, looking good!

And windows support. But I personally don't mind windows support being missing. Fuck 'em. Continuing to settle for windows with alternative implementations and things like Wine only gives windows more power as an antihero. Let them be forced to adopt a Linux kernel, no compromise.

Edits: typos

Re: Crystal 0.25.1 released

#99
post #70

Earlier quoted context omitted.

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 ;)

What other people subject themselves to is none of my business :)

And there is need for HTTP frameworks in Rust, for example embedded stuff often hosts HTTP servers. However, just like C we frameworks, it's my opinion they're not for the average use case.

Re: Crystal 0.25.1 released

#100
post #11

Earlier quoted context omitted.

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…

Great response. [EDIT - as highlighted by the replies below you can't use Rails with Crystal...my fault for misreading the parent] I didn't quite realize that I could use Rails with Crystal. That would be make it more interesting if I knew how to use Rails ^^

Lucky uses type safety extensively preventing a lot of bugs. My team really enjoys working with it. You should definitely check it out.
Post reply on HN