Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
asterite
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
1.
▲
by
asterite
5y ago
Those functional languages don't have function overloading or named arguments. The type inference in Crystal works very differently. The type of a method can only be computed from explicit calls to it. In those functional languages the
2.
▲
by
asterite
8y ago
"Fast as C" should maybe be changed to something else. Crystal can bind directly to C functions and libraries without any overhead, plus you have pointers and other stuff. So you could really write code that runs as fast as C if y
3.
▲
by
asterite
8y ago
Oh, release builds do take longer. My point of view is that while developing you don't need the `--release` flag, so you can get a more or less fluent experience. The few times where you need to release an app it takes longer, but for
4.
▲
by
asterite
8y ago
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.
5.
▲
by
asterite
8y ago
The compiler takes about 30 seconds or a bit more to compile, and it has around 50000 lines of code. Do you have the few hundred lines that took you 30+s to compile?
6.
▲
by
asterite
8y ago
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
7.
▲
by
asterite
8y ago
I wouldn't commit to any specific date. It's not something you can timebox.
8.
▲
by
asterite
10y ago
Here are the reasons for 'end': https://github.com/crystal-lang/crystal/wiki/FAQ#why-isnt-th...
9.
▲
by
asterite
10y ago
Yes, it will be available before 1.0. It's on the roadmap.
10.
▲
by
asterite
10y ago
Yes, this is what Crystal 1.0 will look like. Parallelism is on the roadmap.
11.
▲
by
asterite
10y ago
We do, and we will. We are working on it :-)
12.
▲
by
asterite
10y ago
Thank you! I didn't know that easy way to reply. The compiler does some incremental compilation for the generated object files, so compile times are kept relatively small. Other than that, I don't think it makes a big difference f
13.
▲
by
asterite
10y ago
I can't seem to reply to your reply to this, but the error message has nothing to do with where a class is defined. You can't compile a part of your application in crystal, there are no linked crystal libraries. You compile your w
14.
▲
by
asterite
10y ago
We (think we) have good reasons for that: https://github.com/crystal-lang/crystal/wiki/FAQ#why-isnt-th...
15.
▲
by
asterite
10y ago
It will simply stop compiling the code and it will say "undefined method 'talk' for Snake". You will get a similar error if `talk` is defined as an abstract method in the base abstract class. So abstract methods are just
16.
▲
by
asterite
11y ago
We mostly want to never have to do this. This way we can guarantee that "no method error" never happens at runtime (one of the most feared exceptions after a big refactor in a dynamically typed language)
17.
▲
by
asterite
11y ago
Thank you for the detailed analysis! Yes, Crystal will definitely need a lot of work. On the other hand, maybe this work is also fun :-) Also there's the thing that Go has big Google behind it, so of course it's much more advanced
18.
▲
by
asterite
11y ago
All the languages couldn't fit in the talk, but the full benchmarks are here: https://github.com/kostya/benchmarks As always, take benchmarks with a graint of salt. We use benchmarks mostly to know how far away we
19.
▲
by
asterite
11y ago
It will never run Rails. Crystal is just heavily inspired by Ruby, but has already diverged in a lot of places in terms of syntax and semantics. Plus, Ruby has "eval" and "send", which Crystal don't and will (probab
20.
▲
by
asterite
11y ago
The current HTTP server is pretty fast. Did you try compiling/running your program with the `--release` flag? It's explained a bit here: http://crystal-lang.org/docs/using_the_compiler/index.html Crystal
21.
▲
by
asterite
11y ago
Not quite. The language allows you to program using duck-typing, in a way. For example if you have a variable "duck" and you assign a Duck to it and invoke "quack" on it, given a Duck quacks, it will work. Now if later y
22.
▲
by
asterite
11y ago
There's support for cross-compilation, it's even documented: http://crystal-lang.org/docs/syntax_and_semantics/cross-comp... But porting stuff to Windows is far from trivial: there's making LLVM wor
23.
▲
by
asterite
11y ago
In Crystal we also have sum: http://crystal-lang.org/api/
24.
▲
by
asterite
11y ago
I don't think it's a big deal, benchmarks are just toy programs. Once you learn about the `--release` flag you never forget it for production-ready code. C has -O3, why isn't it the default? Because it takes a lot more time t
25.
▲
by
asterite
11y ago
Yeah, we need to document this better, sorry!
26.
▲
by
asterite
11y ago
Did you compile the Crystal program with the --release flag? That turns on optimizations. On our machines we see Crystal is faster in this benchmark, it always takes about 1.6s while JRuby+Truffle reaches 2.38 at most.
27.
▲
by
asterite
11y ago
A tiny observation here: we don't do "null pointer analysis". We do this kind of analysis for every type: if you invoke a method on a type and that method doesn't exist, you get a compile error. In the case of a type uni
28.
▲
by
asterite
11y ago
In the beginning Crystal didn't free memory. We needed a GC and Boehm was a super easy way to get that. It worked out of the box with very little effort. Eventually we can write our own GC or use another one. It's only a matter of
29.
▲
by
asterite
11y ago
Almost. You at least need to exercise the code at compile time. For example you could write dummy usage tests like this: typeof(MyClass.new.some_method(1, 2, 3)) That basically says "the above compiles and has some type", so you d
30.
▲
by
asterite
11y ago
I don't think it matters much that it's hard to parse: very few are going to write a parser for that language compared to the ones that are going to write programs in the language. It goes the same for everything else in a languag
More ›