Live data from Hacker News

Why Crystal is the most promising programming language of 2018

medium.com

81–90 of 109 posts

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

#81

Earlier quoted context omitted.

Thank you for taking the time to answer the question. In principle, I know how it ought to work. But when would I need to use it? For instance, if someone is making a web api, and you're pulling data from a database, should one think about it? If one is doing some data analysis, should one think about it? I always thought that it is a "low level" program that takes care of it. So tensorflow might worry about it, but…

I don't know your experience so I'll do my best to draw on examples _I suspect_ you might be familiar with. I'll try to keep this simplified but deep enough. I'm taking a shot in the dark and hoping you're more familiar with the one of the python/node/ruby world. You should worry about it when you want to do something faster than you are already or want to do more things at once. Maybe someone's framework/service has…

Great answer. You should post that on a blog if you have one.

This was the best part if you want to expand on it in a longer post: "You should worry about it when you want to do something faster than you are already or want to do more things at once. Maybe someone's framework/service done it for you maybe not.

For a web api, the workload _usually_ looks like: {database call} -> {do some work} -> {maybe more calls} -> {more local work} -> {done}.

In the python/node/ruby world where you have mostly single process workers. You get some parallelism by doing work locally while the database call is made asynchronously. If you want to handle more requests on a host you'll just run more processes and load balance across the front (nginx, gunicorn, etc). In languages with threads you usually do that INSIDE your program. A single process load balances across worker threads internally.

At first blush, multiple threads are pretty similar to just running multiple programs. It gets more complicated when you start talking about how you want to communicate between them or share resources across them."

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

#82

I've been keeping my eye on Crystal for a while now thinking about making the plunge and writing something production ready in it. But I'm a bit vary as for the casual observer the Crystal project github ( https://github.com/crystal-lang/crystal ) seems brim with unsolved issues (over 500 issues!) and stale PR-s (over 105!). I'm not sure if this is a sign of poor project managment, development stall or poor community…

I for one have found the crystal community to be very responsive to the issues I have reported. I'd rather have a project leave 500 issues open than just close everything in sight like many large projects do.

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

#83
post #56

Earlier quoted context omitted.

That's great and thank you for responding! I agree that the number of open issues is not a good indicator of project management. I was more worried about PRs being open in 2016, 2017 and still lingering - this in connection with a large number of open issues seemed like a possible red flag. But it may be just an issue of triage. Keep up the good work!

Every project has it's warts, long running feature requests, and it's bugs so minor nobody's gotten around to fixing them. Some projects decide to hide those by closing the issues, we generally keep them open, because they are still valid issues.

And I think this is a good sign of a projects positive health ^

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

#84
post #35

I never seem to be able to get into all of these new languages, mostly because I do not see a clear use case for it. The last two languages I learnt were Python, because we have our backend written in it and Swift for a personal project because it is what one writes iOS apps in today. I fail to imagine a kind of application that would warrant to learn a new general purpose language on top of what I already know. Well…

At BlockVue we are using crystal in production to solve some very computationally expensive constraints programming problems that we would otherwise likely have to tackle in C/C++.

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

#85
Looks cool, in a similar vein as Zig or NIM it seems?

A few questions:

Out of curiosity, is there a company behind Crystal? or is it a BDFL situation? The press on Crystal has been pretty significant lately which is great. I ask mostly out of historical interest. IIRC Rust/Go seem to had company backing while gaining traction but Python/Ruby were more organic BDFL led projects. Naturally C/Java/C# were literal company products.

While the Ruby-like syntax is not to my taste (prefer Python) it got me thinking about what are the big syntax families? Off the top of my head I count: Lisp, C, Python, Ruby, Prolog, ML, APL? Preemptively apologizing for only knowing the popularizers over the originals.

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

#86
post #67

Earlier quoted context omitted.

Parallelism is large part of the answer to question of "how do we make this thing as fast as hardware allows" (most people will add "easily" to that). Or "as fast as our users demand" if it makes it easier to understand. The use for that comes with scale, there is a one caveat though: it is often impossible to add this as an afterthought to your program and to programming language. If you choose programming language…

Thank you for taking the time to answer the question. In principle, I know how it ought to work. But when would I need to use it? For instance, if someone is making a web api, and you're pulling data from a database, should one think about it? If one is doing some data analysis, should one think about it? I always thought that it is a "low level" program that takes care of it. So tensorflow might worry about it, but…

If all you ever deal with are what are known as "embarrassingly parallel" problems, where you don't need to do any synchronization or intermediate communication between cores, then true parallelism isn't really needed and you can do whatever you were trying to do with simple process forking or something of that nature. Problems that are not embarrassingly parallel often require frequent and complicated communication and synchronization between cores. For this you need to use a real multi-threading library, or do some complicated message passing on a per-process level. If you need hundreds of workers, it is better to use something more light-weight than a thread, as Go does. Once crystal's parallelism support is added, it will have these light-weight "go-style" threads, so this complaint will disappear.

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

#87

The next big programming language will compile to WebAssembly, crystal doesn't (yet).

Yeah I'm really crossing my fingers for this one as well. Imagine writing all your server side code in crystal, as well as your front end. Droool..

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

#88
post #42

no parallelism hmm right thats such a small tradeoff in a world where 32 core 64 HT CPUs are available from mainstream vendors. I'll take Elixir and/or Rust.

They already have go-style parallelism working in a branch -- its coming very soon

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

#89
post #13

Earlier quoted context omitted.

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.

This is also the current state of the crystal repl shard

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

#90
post #29

Earlier quoted context omitted.

Both are also difficult to google search XD

Searching for "dlang" returns decent/passable results.

with crystal we have to deal with all these stale "crystal reports" results as well :/
Post reply on HN