Live data from Hacker News

Why Crystal is the most promising programming language of 2018

medium.com

21–30 of 109 posts

Re: Why Crystal is the most promising programming language of 2018

#21
post #7

> Nothing else puts all of these ingredients together (compile-time macros, static typing, C-like speed, Ruby-like syntax, gem-like package ecosystem, native binary compilation, fibers, and cross-platform support) Something I've noticed when reading 'X language is great' posts, the comparison is usually limited to a narrow subset of what's out there. As an example, I think D meets all of the above criteria. Maybe I'l…

This is the entire reason I got burned out on new languages.

I learned to minimize burns by looking at everything that comes out as learning process, there is always something that makes us better developers.

However for production code I only use the programming languages directly supported by platform owners.

Of course others rather take part in ramping up eco-systems and that is fine as well, otherwise we wouldn't get new toys adopted by platform owners.

Re: Why Crystal is the most promising programming language of 2018

#22
post #16

> Because Crystal is compiled, it is impossible to have a true REPL First of all, the problem isn't that it's "compiled" - Python is "compiled" too, but still has one of the best REPLs available. The problem is that the language is static. But static (and compiled) languages can have REPLs, for example C++ has an excellent REPL called Cling. It's not impossible, just requires some more effort. As for Crystal, it look…

> First of all, the problem isn't that it's "compiled" - Python is "compiled" too, but still has one of the best REPLs available.

In a way it is. For a REPL you most likely need an interpreter for your language, like Cling is for C++.

Re: Why Crystal is the most promising programming language of 2018

#23
post #13
post #6

> Because Crystal is compiled, it is impossible to have a true REPL Impossible, or just hard?

I had a quick search, REPLs exist for C, C++, D, Go, and Rust (my shortlist of statically typed, compiled languages). I would question what is meant by a 'true REPL'. It's certainly seems possible to build a REPL of a statically typed compiled language.

I don't know about the others (reportedly Cling for C++ is good) but the Rust repl doesn't work properly and is basically just a frontend for incrementally writing a Rust file.

Re: Why Crystal is the most promising programming language of 2018

#24
hey guys OP here just a note on parallelism -- once windows support is done (very soon), parallelism is the #1 priority of the dev team. If you are looking for syntax examples check out the docs there are tons of examples here: https://crystal-lang.org/docs/syntax_and_semantics/

Re: Why Crystal is the most promising programming language of 2018

#26
post #16

> Because Crystal is compiled, it is impossible to have a true REPL First of all, the problem isn't that it's "compiled" - Python is "compiled" too, but still has one of the best REPLs available. The problem is that the language is static. But static (and compiled) languages can have REPLs, for example C++ has an excellent REPL called Cling. It's not impossible, just requires some more effort. As for Crystal, it look…

Yeah, to clarify this should be possible, but I don't think it's going to happen for some time. There is a shard that creates a REPL, but it re-executes all previously executed commands each time you enter something new, which is super bad and dangerous. What we need is something that will compile just the line that was entered, and somehow "inject" that line into the existing program, and execute only that next line. Also there might always be a bit of lag between when you enter a line and when you get your response because the compiler is invoked. I'm not sure if that could be optimized to the point where it isn't noticable, but that would be super cool. I added on functionality for the Amber framework that allows you to execute one liners via `amber exec "code here"` as a replacement for `rails console` (amber is basically the rails of the crystal world).

Re: Why Crystal is the most promising programming language of 2018

#27

Well, here is why not. AFAK, it still lacks support for parallelism / multicore programming. Please correct me if I'm wrong. Once it has that, I'll be happy to learn it, but currently it's concurrency seems to be as limited as Racket's. That's a big obstacle for early adoption, since the trend is going towards 64 cores sooner than later. My current CPU already has 8 physical cores and 16 logical cores, and I'd like t…

This is a big advantage of Nim (https://nim-lang.org/), which on the face of it is a pretty similar kind of language with a more Python-like syntax. Nim supports real threads with message passing channels (similar to Go).

Re: Why Crystal is the most promising programming language of 2018

#28
post #22
post #16

> Because Crystal is compiled, it is impossible to have a true REPL First of all, the problem isn't that it's "compiled" - Python is "compiled" too, but still has one of the best REPLs available. The problem is that the language is static. But static (and compiled) languages can have REPLs, for example C++ has an excellent REPL called Cling. It's not impossible, just requires some more effort. As for Crystal, it look…

> First of all, the problem isn't that it's "compiled" - Python is "compiled" too, but still has one of the best REPLs available. In a way it is. For a REPL you most likely need an interpreter for your language, like Cling is for C++.

It can be argued that "compiled/interpreted" is not a property of programming languages, but of programming language implementations.

Re: Why Crystal is the most promising programming language of 2018

#29

I'm reading through the list and it looks like D has all these, except the ninth one ("meteoric rise in popularity"). However, it does have binary compatibility with C and the binaries are much leaner.

Both are also difficult to google search XD

Re: Why Crystal is the most promising programming language of 2018

#30
post #22
post #16

> Because Crystal is compiled, it is impossible to have a true REPL First of all, the problem isn't that it's "compiled" - Python is "compiled" too, but still has one of the best REPLs available. The problem is that the language is static. But static (and compiled) languages can have REPLs, for example C++ has an excellent REPL called Cling. It's not impossible, just requires some more effort. As for Crystal, it look…

> First of all, the problem isn't that it's "compiled" - Python is "compiled" too, but still has one of the best REPLs available. In a way it is. For a REPL you most likely need an interpreter for your language, like Cling is for C++.

You don't need an interpreter for a REPL. Swift's REPL performs line-at-a-time compilation, running the program to that line and suspending it until you write and compile another line.
Post reply on HN