Live data from Hacker News

Building a Command-Line Application with Crystal

jclem.net

21–30 of 35 posts

Re: Building a Command-Line Application with Crystal

#21
post #19
post #7

Earlier quoted context omitted.

i think nim has better compiler options (in particular, i don't know if it has already achieved go-like cross-compilation of static binaries, but if not it's further along that road than crystal is). https://nim-lang.org/docs/nimc.html meanwhile, crystal does not even support windows yet. https://github.com/crystal-lang/crystal/issues/26

Go-like cross-compilation only works with pure Go libraries that don't make use of either syscalls or cgo.

I keep hearing praise over how easy it is to statically compile Go applications. Does the same apply to static compilation? Is it only easy when using pure Go libraries?

Re: Building a Command-Line Application with Crystal

#22
post #21
post #19

Earlier quoted context omitted.

Go-like cross-compilation only works with pure Go libraries that don't make use of either syscalls or cgo.

I keep hearing praise over how easy it is to statically compile Go applications. Does the same apply to static compilation? Is it only easy when using pure Go libraries?

according to https://dave.cheney.net/2016/01/18/cgo-is-not-go

> It is possible to compile a Go program entirely statically, but it is by no means simple and shows that the ramifications of including cgo in your project will ripple through your entire build and deploy life cycle.

(that article also contains the beautiful line "You’re not writing a Go program that uses some logic from a C library, instead you’re writing a Go program that has to coexist with a belligerent piece of C code that is hard to replace, has the upper hand negotiations, and doesn’t care about your problems.")

Re: Building a Command-Line Application with Crystal

#23
post #21
post #19

Earlier quoted context omitted.

Go-like cross-compilation only works with pure Go libraries that don't make use of either syscalls or cgo.

I keep hearing praise over how easy it is to statically compile Go applications. Does the same apply to static compilation? Is it only easy when using pure Go libraries?

Usually those praises come from young developers that never developed software back in the days when static linking was the only option.

So they look at Go's static linking, their experiences using -static in gcc and glibc, and think they just found something magical.

It is interesting the amount of knowledge that gets lost within a few generations.

Re: Building a Command-Line Application with Crystal

#24

Anyone compare Nim to Crystal? Both are AOT languages with syntax inspired by dynamic languages (Python & Ruby). Nim transpiles to C and Crystal uses LLVM. I've been playing with Nim, but I have a feeling Crystal will catch on quicker.

CoC, bad compiler, bad type system, no formal proofing whatsoever, some of documentation reads like someone who knows English as a second or third or fourth language wrote it, in some cases it's just plain wrong. Elixir has already taken most of the ruby mindshare, the crystal team really isn't hacking it when it comes to presenting why crystal should be used instead of ruby except for speed. That its faster is the o…

>CoC

I'm sorry, what does that mean?

>bad compiler, bad type system

I'd love to hear some feedback from you about the compiler and type system, so that we can discuss and improve them.

>no formal proofing

Ary has expressed interest in formally defining crystal's type system, but its understandably far down the list of priorities.

Re: Building a Command-Line Application with Crystal

#26
post #19
post #7

Earlier quoted context omitted.

i think nim has better compiler options (in particular, i don't know if it has already achieved go-like cross-compilation of static binaries, but if not it's further along that road than crystal is). https://nim-lang.org/docs/nimc.html meanwhile, crystal does not even support windows yet. https://github.com/crystal-lang/crystal/issues/26

Go-like cross-compilation only works with pure Go libraries that don't make use of either syscalls or cgo.

True and pretty obviously so, but Go is still fantastic in this regard. :) Compare to other native cross-compile stories like with how you'd have to go about to cross compile a Qt app on Linux to Windows... Or even worse to Mac.

Re: Building a Command-Line Application with Crystal

#27
post #26
post #19

Earlier quoted context omitted.

Go-like cross-compilation only works with pure Go libraries that don't make use of either syscalls or cgo.

True and pretty obviously so, but Go is still fantastic in this regard. :) Compare to other native cross-compile stories like with how you'd have to go about to cross compile a Qt app on Linux to Windows... Or even worse to Mac.

Have you ever tried to cross-compile a Go application using native UI toolkit?

Re: Building a Command-Line Application with Crystal

#28

Earlier quoted context omitted.

> ... some of documentation reads like someone who knows English as a second or third or fourth language wrote it, ... Um, what's wrong with that? Not everyone gets to learn English as their first language, do their efforts deserve to be discarded just because of that? I mean, I could point out that your grammar ('some of documentation') invalidates your entire comment, but that's kinda silly.

I absolutely do not share the opinion of person to whom you are replying, but to state that their comment is invalid due to a trivial typo is unnecessary, and has potential to be incendiary.

I mean, that's why I said:

> ... but that's kinda silly.

Re: Building a Command-Line Application with Crystal

#29

Earlier quoted context omitted.

> ... some of documentation reads like someone who knows English as a second or third or fourth language wrote it, ... Um, what's wrong with that? Not everyone gets to learn English as their first language, do their efforts deserve to be discarded just because of that? I mean, I could point out that your grammar ('some of documentation') invalidates your entire comment, but that's kinda silly.

> I could point out that your grammar ('some of documentation') invalidates your entire comment, but that's kinda silly. He's not writing the hopefully high profile documentation for a project that people want to be used, ffs. No, it doesn't deserve to be discarded because of that, but it's clearly suboptimal.

You make it sound as if this version of the documentation is set in stone, forever. Can't small projects improve their documentation as they grow in popularity? E.g. do you think that Linus Torvalds' Linux documentation was always up to the highest standards of Strunk & White's prescribed English?

Re: Building a Command-Line Application with Crystal

#30
I really, really like crystal but was bitten a few times on a project because it is still not quite ready for primetime.

Because its so young, there have been a handful of breaking changes which affected my code a few times (and even worse, my dependencies).

They have a good concurrency model but I'm waiting for them to add parallelism.

I mostly just crave the solidarity in tooling, dependencies, APIs, compiler options/performance which will come after hitting 1.0 (i hope). I'm excited for the day I can go all in. Keep it up Crystal team!

Post reply on HN