Live data from Hacker News

Why Crystal is the most promising programming language of 2018

medium.com

11–20 of 109 posts

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

#11
post #6

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

You'd need an interpreted runtime for the language for that to work. D has a 'scripting' runtime but I'm not sure if anyone's done a REPL or what the limitations would be.

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

#12
post #6

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

The main difference between compiled and static languages is that compiled languages go through a phase of "checking your work", where it compares parts of your program to other parts before running it. For example, if you misspelled a name, the compiler will look everywhere in your program for that name before you run it, and tell you it can't find the name. That's why we like compiled languages. By contrast, dynamic language handle this by looking up the name right before the code in question is executed. If the name's not there at that time, an error is thrown.

Now think about this in the context of a REPL, which again stands for Read, Evaluate, Print, Loop. If you write code and evaluate it right away, this whole business about checking your work won't work right. You would basically have to recompile your entire program on every REPL eval, which defeats the whole purpose of a REPL. There are lots of other tricks to getting this to work, as the article hints at, but they're all very unsatisfactory in delivering the freedom of a dynamic language.

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

#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.

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

#14

> Recently Crystal shocked the world when it rose from 60th place to 32nd place in the Tiobe index in a mere month Meteoric! Because we all know the the Tiobe index is incredibly accurate. Would have been nice to see some code examples, rather than just handwavey bullets points that you could write about nearly every up-and-coming programming language.

Also, "meteoric rise" is kind of silly. That's not how meteors work.

Meteors fall, so they must also rise. Because physics?

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

#15
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.

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

#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 looks like a neat language. However, if it's going to try to compete with the fast compiled runtimes such as Java, it will need some parallelism support.

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

#17

> Recently Crystal shocked the world when it rose from 60th place to 32nd place in the Tiobe index in a mere month Meteoric! Because we all know the the Tiobe index is incredibly accurate. Would have been nice to see some code examples, rather than just handwavey bullets points that you could write about nearly every up-and-coming programming language.

> Because we all know the the Tiobe index is incredibly accurate.

More importantly, the TIOBE index is just a web noise indicator. A dedicated marketing guy focused on dumping the project's keywords throughout the WWW is all it takes to manipulate the ranking.

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

#18
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…

Not only that, while ongoing Crystal efforts might be great, lets not forget it is a path already traced by the likes of Common Lisp, Dylan and Ruby motion.

So other that the gem-like package ecosystem and a syntax familiar to Ruby developers, it isn't particularly new.

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

#19
post #6

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

You'd need an interpreted runtime for the language for that to work. D has a 'scripting' runtime but I'm not sure if anyone's done a REPL or what the limitations would be.

/smug-lisp-weenie-mode

I didn't realise that SBCL is interpreted.

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

#20
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…

Native binary is not a clear statement. On Android is CPU-native, really native? Or is CLR the future of Windows? CPU-native does not mean much. It means that you have a competition of almost all languages, that have head start and better tooling.

"Is FFI cheap on all interesting platforms?" is a better question, than "Does it compile to CPU-native binary on all interesting platforms?". In this space you only kinda get some JVM languages, but on Windows you would have to do something more special. Scheme to some extent. Also Haxe.

If you don't care about it you can read the rest of this thread with all other favorite languages. I for one cheer for Myrddin, Pony and Zig.

I was thinking lately about an imperative language, that would be easily compiled to other first class languages. To serve as a cross-platform core of application. It would be quite limited - for example no heap allocations. Something maybe akin to Google's Wuffs language. Just an idea on the one edge of the problem.

Post reply on HN