Out of all the programming languages coming out these days, Crystal is the one I am watching out for. I've never programmed with Ruby, but I have programmed with Python in the past so I really value the focus on programmer friendly syntax that Python taught me. Currently a Golang a programmer and I love the performance plus binary executables! From my experience so far Crystal feels like a performant language with th…
Just curious whether you have checked out Nim. I love it coming from Python, curious to know what Crystal offers apart from Nim for Python users.
The Crystal Programming Language
101–110 of 116 posts
Re: The Crystal Programming Language
#102Now, all we need for crystal to succeed is numpy, scipy, something pandas-like, and of course matplotlib (not plots, matplotlib). By the way, how are we on data-science friendly IDEs? Debugging? Automatic thorough documentation generator? Tooling in general? Is the time to first plot fast? Where I work, we desperately need a fast python.
>... numpy, scipy, something pandas-like, and of course matplotlib... Where I work, we desperately need a fast python. It sounds like Julia would be a better fit than Crystal? Ironically they have similar problems: compile/start-up time (though crystal has working ahead of time compilation - AFAIK Julia developers are still working on speeding up "first run" in various ways).
Re: The Crystal Programming Language
#103Earlier quoted context omitted.
Nim and Crystal feel like they are in exactly the same space? GC, fast, single executable compilation without runtime (I would also throw Go into this list).
there is a runtime. its just baked into the final executable. you can't have garbage collection without one.
It is fully deterministic, so it simply injects alloc/free calls in the generated code at compile time. It even has an option that can show you where the calls are injected.
https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc...
Re: The Crystal Programming Language
#104Earlier quoted context omitted.
> 3. Obscure error messages (macros are to blame here) I feel like this is a bit strongly influenced by the macro experience. Macros are an advanced and powerful feature and naturally more complex to debug. In general, Crystal's error messages are often praised for their clarity and helpfulness (especially compared to dynamically typed languages, of course). > 4. Weak HTTP server implementation -- making things such…
> Windows support is pretty stable and almost complete by now. This isn't really a genuine statement. Currently Crystal Requires a full installation of Visual Studio on Windows: https://github.com/crystal-lang/crystal/issues/6170
But after the executable binary is compiled then it can run without any dependencies. I think the later is more important for a window program.
I gave the exes to my users and none of them had any problem running it.
For development currently WSL is still the best way to run crystal in windows.
Re: The Crystal Programming Language
#105Earlier quoted context omitted.
Nim and Crystal feel like they are in exactly the same space? GC, fast, single executable compilation without runtime (I would also throw Go into this list).
You can ditch Nims GC and runtime and bring your own if you want. Of course you'd lose access to most of the stdlib but this is why Nim can be used and is popular for embedded / bare metal. Tmk Crystal still lacks Windows support as well and probably other os's / archs's compared to Nim
https://crystal-lang.org/reference/1.4/syntax_and_semantics/...
Of course, same as Nim, you lose access to most of the stdlib.
Re: The Crystal Programming Language
#106Let's migrate RoR to CoR
https://github.com/luckyframework/lucky
Development by folks come from thoughtbot.
Re: The Crystal Programming Language
#107Earlier quoted context omitted.
> Windows support is pretty stable and almost complete by now. This isn't really a genuine statement. Currently Crystal Requires a full installation of Visual Studio on Windows: https://github.com/crystal-lang/crystal/issues/6170
Yes, for compile crystal program to windows binary, you need to install VS Build Tools. But after the executable binary is compiled then it can run without any dependencies. I think the later is more important for a window program. I gave the exes to my users and none of them had any problem running it. For development currently WSL is still the best way to run crystal in windows.
WSL is never the best way to do anything, unless the question is "what is the best way to emulate Linux on Windows?". In all other cases, WSL is literally the worst way to do anything.
Re: The Crystal Programming Language
#108I'm a Ruby guy and I tried Crystal for about 2 years and absolutely loved it but then had to give up for the following reasons: 1. Too slow to compile (the whole program + the entire stdlib is built everytime you build!). No incremental compilation available. 2. No language server (apparently it's just impossible due to the way the language works). Tbh, I'd be happy with just "Go to definition" but alas, no-can-do! 3…
This works on Doom Emacs!
Re: The Crystal Programming Language
#109Earlier quoted context omitted.
What about it makes you cringe?
This kind of thing End End End End End
You have the option to define named methods that yield or to use the short one-parameter syntax where this:
method do |param|
param.some_method
end
becomes method &.some_methodRe: The Crystal Programming Language
#110What is the edge it gives when compared to Rust, Zig, and Nim?
Nim is very close to Crystal. Some parts that might lead you to prefer Crystal however:
- Nim compiles to C code, meaning Nim is coupled to what C can do. I find compiling to C to be distasteful, C is not meant to be a compilation target. We should be getting away from C, IMO. Nim is limited to what C can achieve, and the design of the language trends towards "here's how this translates to C" as a result. Compiling to C is also an extra layer of abstraction, as now for instance with debugging you have to go through the C layer. Crystal like Rust uses LLVM
- Crystal also uses Ruby syntax, which many prefer. I have grown to dislike semantic whitespace such as how Python works, so this is a plus for me.
- Crystal has a garbage collector, period, and leans into that. Whereas Rust, Zig, and Nim want to give you complete control over memory, Crystal is more focused on being a better high-level programming language, competing with the likes of JVM/NET/Go/Ruby. This focus is likely Crystal's main edge. The only other single-executable opinionated GCed language is Go. Crystal's type system is much better than Go's. If Crystal can reduce compile times and capture some of Go's pragmatic aura, it will see more success.