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…
> 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?
Crystal 0.25.1 released
121–130 of 154 posts
Re: Crystal 0.25.1 released
#122Re: Crystal 0.25.1 released
#123Earlier quoted context omitted.
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.
Yes, and I can see HTTP frameworks in Rust useful for turning high-performance libraries into web services that can be used by other applications.
Re: Crystal 0.25.1 released
#124I 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?
Crystal supports static linking with `--static`, unfortunately glibc and openssl don't like static linking, so it turns out to be easier to do in an alpine linux chroot/container/etc which uses musl instead of glibc. Crystal is in the alpine linux repositories as of 3.8, so this should be now a lot easier. If someone wants to generate some good tooling around this workflow, it'd be greatly appreciated.
Re: Crystal 0.25.1 released
#125Only noticed this in the release post, but the `record` feature is neat: https://crystal-lang.org/api/0.25.1/toplevel.html#record(nam...
Re: Crystal 0.25.1 released
#126Earlier quoted context omitted.
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() }
The same as grandparent, in crystal:
"1 2 3".split.map &.to_i.*(2)Re: Crystal 0.25.1 released
#127Earlier quoted context omitted.
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
#128Re: Crystal 0.25.1 released
#129Earlier quoted context omitted.
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.
Particular to the c library? Because an "ldd" on the hello world listed quite a few libs which all worked fine with a static build.
Re: Crystal 0.25.1 released
#130I've played around with a number of languages and settled on Crystal because: * Speed * Pleasant to use type system * Doesn't get in my way * Catches lots of bugs * Fun! I wrote http://luckyframework.org/ to write web applications with minimal boilerplate and as few runtime errors as possible. Take a look and let me know what you think