10 ms·
I feel like Crystal isn't as popular as it should be. I did part of last years Advent of code in it, and it was very easy to convert Ruby solutions to working C
by weatherlight 5y ago
I feel like Crystal isn't as popular as it should be.
I did part of last years Advent of code in it, and it was very easy to convert Ruby solutions to working Crystal solutions that were as fast as the the Go solutions my buddy had submitted.
It's a really impressive language, I hope it doesn't fizzle out.
- chshrct 5y agoWhen you have Go you don't need another similar language
- weatherlight 5y agoExcept then you're writing Go.
- dunefox 5y agoBut then I'd have to program in Go.
- dleslie 5y agoCrystal, Carp and Nim are my "I hope these catch on" languages. Each has an elegant and intriguingly modern approach to performance targeting programming.
- dunefox 5y agoI still hope for Common Lisp 2: Electric Boogaloo.
- vips7L 5y agoD is the one for me.
- sidkshatriya 5y agoWhy is D the one for you? Between Crystal, Zig, Nim and D it does seems that D is the most "mature" and production ready...
- vips7L 5y agoPersonally I don’t like the syntax of crystal or nim. As for Zig I’ve used it (I rewrote the xv6 user space programs in it, and plan to rewrite the rest of the kernel in it one day) but for day to day I don’t want to manage memory. I like D because it’s a blend of high level and low level. It’s natively compiled and if GC becomes a problem I can just turn it off in critical sections instead of playing with C FFI shenanigans. It’s an extremely ergonomic language with amazing metaprogramming and error handling (unlike Go). It gives me full control of memory and the cpu via pointers, scoped allocations, and in-line assembly if I need it. Which results in a light weight binary and low memory usage (unlike Java and C#).
- ofrzeta 5y agoIs there any metric on how huge the D community is? It has been there for a long time ..
- ogma 5y agoThe language creator is a complete tool and has repelled anyone intelligent from contributing.
- dnautics 5y agoD has been a bit of a "fail to launch" (not literally) for a long time now (2 decades?). What do you suspect has changed?
- vips7L 5y agoI don’t think much has changed except today’s developers are more open to natively compiled GC’d languages. Two decades ago everything was running in the JVM or CLR. But today we’re seeing investment in Go, nim, etc. I also think two decades ago you didn’t need your app to run everywhere. D can be your web app backend, it can compile to wasm, and it can be compiled to a shared library while still keeping you productive with a GC or without a GC if that’s your thing. This means you have a shared library that your electron desktop app can use or your iOS Swift app can use.
- dnautics 5y agoI think D tried to be too many thing for too many people. The "better C" paradigm is obviously desired (Nim, V, Zig, and others) but the D approach was to add more to C, (as is nim and V)... I guess zig is unique in that it started by removing things from C and adding one big thing and a few small things.
- vips7L 5y agoI love Zig! I started rewriting xv6 in it last year (I should probably get back to that). Just in my day to day I don't want to manage memory, but I still want performance. I'd write Go, but I'm just not a fan of its general approach to anything. I do agree D has a problem of a split community. You see it on the forums with 50% just wanting better C++ and 50% going GC. I'm actually looking forward to C# AOT sometime soon.
- pjmlp 5y agoTwo decades ago we also had natively compiled GC’d languages (VB 6 was the most mainstream one). Sun spoiled their uptake by pushing Java the way they did.
- arthurcolle 5y agoD is dead
- sidkshatriya 5y agoComputer languages are like people: some remain successful throughout their lives, some fade into obscurity after an initial popularity, some bloom in middle age, some are excellent but never gain a following and so forth... It's too late to pronounce any language dead. Not only is it hurtful to those who use the language, the pronouncement may also be wrong! :-) For example, one of the languages that I really like is OCaml. You could say that OCaml is a super niche language like D. It's kinda undergoing a renaissance today with the upcoming OCaml 5.0. Some important software is written in OCaml e.g. Coq, pyre-check, flow, rescript, infer etc. I see OCaml remaining relevant and excellent in the years ahead whether or nor it amasses a huge following. In other words, the number of people using a language is just one of the metrics you should use to assess the language. D has shown a long term resilience that is amazing. The language has been steadily improving and getting refined for a very long period of time which is admirable. So many open source projects run out of steam in a couple of years! Not the case with D! D has a native, gcc and llvm backend. Quite amazing huh!? One thing I would say though about D: The language needs to decide who it wants to be. Go wants to be minimalist garbage collected language with a good concurrency/parallelism story. Rust wants to be a safer C++ with full control on memory. Java wants to be object oriented and garbage collected. Because its mission is not clear, it ends up trying to please everyone but delight no one! The day D decides what it wants to be _and_ this message comes from top leadership it will become much more successful! D can still achieve a lot in the future...I am rooting for D to be more successful in 2020s and beyond!
- pjmlp 5y agoI agree, but for that to happen, they have to actually finish the "next big feature" before jumping into the next one that will bring people into D.
- egeozcan 5y agoI used to like D, but then, the GC story got too complex and nowadays for non GC there are many alternatives and for GC there's always C#, which I see covering 99% of the GC enabled use cases for D. I really hate language bashing, and I'd have liked D to succeed, but I'm not sure where it fits anymore.
- pjmlp 5y agoThe Andrei's book that made me aware of the language was published in 2010. In 2021 Java and C# aren't the same languages as in 2021. The midori team rejoined .NET and has brought many of the learnings into .NET Core, since C# 7.0, C# has been surfacing CLR features that were only available to C++/CLI, and .NET 7 (yeah still one year away) will finally fix the whole ongoing AOT story. There are runtimes like Meadow for embedded development, runing on top of NuttX. Java has been feeling the pressure of languages like Go, and also so also improving its value types, GPGPU programming and AOT story. Also supports embedded development and there is that phone OS out there, even if the language is a subset of the real deal. C++20 has taken most of the top selling D features (auto, modules, if constexpr, ranges,...), even if in a more clunky way, as always. Then GPGPU programming has made it the SQL of graphics programming. While many argue that Go isn't a systems programming language, others ship compilers, GC, unikernels, Nintendo Switch games, and even firmware written in Go. Rust has been gaining steam across Linux kernel, the OSes from Amazon, Google, Microsoft, ARM. Meanwhile D is still trying to find its niche, without offering the ecosystem of the languages above. The community is great, the language could have been a deal changer 10 years ago, specially when Facebook and Remedy Games played with it (imagine Unity with D instead of C#), but now I fear it has lost the opportunity.
- jhoechtl 5y ago> In 2021 Java and C# aren't the same languages as in 2021 IMHO beginning with the addition of Linq C# walks the way of C++. It is increasingly becoming a language of many faces / aspects. Don't know if this is a good thing.
- regularfry 5y agoThat was, what, 2007? I'm not sure "increasingly becoming" is the right description here.
- pjmlp 5y agoPrograming languages are products, like everything else, adapt, or stagnate and slowly die away. Even C23 isn't the same as K&R C.
- 5y ago
- DeathArrow 5y agoD appeared long time ago. If it didn't get traction until now I think it would be hard to get popularity.
- c0ffe 5y agoI used to like D too. At the time there was an alternative standard library called Tango that was more object oriented like Java or .NET, combined with a desktop UI library (desktop apps were my focus at the time) that was similar to .NET's Windows.Form (I think it was called DFL, and surprisingly the site seems to be still online [0]), plus the native speed & simple approach of D1 I really thought it was going to stay relevant for years. Sadly, then D2 appeared, the community fragmented over time, then Tango was disbanded, and at some point I think I moved on to web development with Flash. [0] http://www.dprogramming.com/dfl.php http://www.dprogramming.com/dfl.php
- 22c 5y agoZig is neat, too. Thanks for the reminder about Carp.
- qPM9l3XJrF 5y agoWhat are the strengths and weaknesses of those three?
- sergiotapia 5y agoNim's elevator pitch is looks like Python so it's easy to read/write, compiles down to C and then to native binaries, and runs so fast it'll make your head explode. Here's a project I wrote in Nim that even if you've never even seen Nim before you would understand what's going on. https://github.com/sergiotapia/torrentinim https://github.com/sergiotapia/torrentinim
- fuzzythinker 5y agoDidn't know about Carp. Posted here https://news.ycombinator.com/item?id=28875051 https://news.ycombinator.com/item?id=28875051 since it hasn't been posted since 2018. Would love to know more about it.
- transfire 5y agoIs there any sane reason to choose C++ any more? Crystal is such a better AOT statically typed OOPL.
- furi 5y agoThe memory management can be quite suboptimal. I wrote the same program in both at one point (an experimental language transpiler) and the Crystal version would spiral up into the 10s of GB when converting a very simple file while the C++ version wouldn't even hit 1 GB. No doubt there was something I could have done to coax it into behaving, but in C++ that was unnecessary. RAII and ordinary standard library containers were enough to make it work. This was a while ago, so perhaps things have improved.
- yumaikas 5y agoThe ecosystem around C and C++, existing projects. C++ code is known to be able to build millions of lines of projects. IIRC, Crystal still struggles there, though I think the last year has had improvements there? To be fair, C++ does as well, but how it struggles is better documented. I'd bet that C++ gives you more low level control than Crystal does, though I'm not deeply familiar with Crystal. Zig and Rust both seem to eat at the space that C++ occupies more than what I've seen out of Crystal, but I have not followed it closely at all, so I could well be wrong there. Crystal feels closer to the Ruby flavor to Nim's Python flavor, and I know syntax doesn't imply low-levelness, but yeah.
- cyber_kinetist 5y agoYou can certainly write very low-level Nim code though, seeing that things like Arraymancer (high-performance tensor library) and Chronos (an async runtime) are written in pure Nim. Everything you can do in C you can certainly do it in Nim (event better, with generics/templates/macros helping you out). And once the garbage collector is finally removed for the new ARC/ORC runtime (think of Objective-C-like reference counting, but much better), it’s definitely a language that can compete with C++/Zig/Rust.
- petre 5y ago
- Thaxll 5y agoWhy should it be popular, it's missing so many things to be popular. For example we're passed v1.0 and they keep breaking APIs. https://crystal-lang.org/2021/03/22/crystal-1.0-what-to-expect.html https://crystal-lang.org/2021/03/22/crystal-1.0-what-to-expe... > After this release, everyone can expect that, at least for any future 1.x version, your code can still compile and work without any significant incompatibility. Language and standard library features won’t be removed or changed in any way that could prevent existing code from compiling and working. The built-in standard library will continue to be enriched but always with backward compatibility in mind. And yet 1.2 breaks many things. Anyway it's not a language that will be mainstream because they don't have the resources to make it serious.
- deleted 5y ago[deleted]
- brigandish 5y ago> And yet 1.2 breaks many things. What are they? I looked at the blog post and it shows deprecations, not breaking changes.
- maattdd 5y agoThe added typing on the stdlib can break stuff, but it's really minor and in most cases it makes visible a potential bug in your program.
- kbd 5y ago> I feel like Crystal isn't as popular as it should be. Seconded. I really wanted to use Crystal for a recent project at work but I wound up writing it in Python because of specific libraries. The experience was like "hmm how do I do connection pooling... oh cool it's built in!". I definitely want to try to use it for something else.
- throw_m239339 5y agoIt's a pain in the ass to compile Crystal programs on Windows. With Go? just download the Go compiler, nothing else, Crystal isn't first class on windows. That's why. A lot of people here don't understand that a good chunk of developers (and students) still use Windows, without any linux subsystem or VM. PHP became popular because of easyPHP on Windows. If PHP never ran on windows it would never have ever gain its popularity, it doesn't matter if it's then deployed on Linux servers.
- zerr 5y agoExactly. Even Google backed Go became popular only after adding Windows support.
- Xevi 5y agoNot only a good chunk, but the vast majority. If I'm not wrong, the StackOverflow survey showed that Windows has the same amount of users as Mac and Linux combined.
- DSingularity 5y agoWow
- WalterGR 5y agoYep. https://insights.stackoverflow.com/survey/2021#section-most-popular-technologies-operating-system https://insights.stackoverflow.com/survey/2021#section-most-...
- DeathArrow 5y agoSome will argue that SO are MS shills.
- Xevi 5y agoAt the same time, the largest demographic of respondents are from the US, specifically California, where the amount of Apple users are way higher than in the rest of the world.
- DeathArrow 5y agoWell, Crystal is trying to imitate a language that is out of the public favor like Ruby. Nim draws it's inspiration from Python which seems to be the most popular programming language as of today so it has better chances to succeed. And if it is as fast as Go, what advantages does it have over Go for someone who doesn't already know Ruby? Go seems easier to learn.
- steve_adams_86 5y agoReflecting on my own experience, I learned Crystal before ruby and found it quite abit easier than Go. For what it’s worth, there are cases where Crystal is faster than Go too
- amw-zero 5y agoNo real point in trying to convince you. You like popular languages - so just pick the most popular one. Also, have fun changing your codebase every 5 years when what’s popular completely changes.
- piokoch 5y agoYes, Cristal looks like a very clean and well designed language... The problem is that being an impressive language is not enough these days. First, tooling is needed, especially good IDE. Nobody is going to memorize names of all the methods in 100K code base and do refactoring by hand or using "find and replace". And debugging story, yes, one can use gdb, but it is not really very convenient. If I were Crystal creator I would concentrate on a well featured IntelliJ plugin. Secondly, integrations and support for ecosystem - databases drivers (looking on the docs there are only for MySQL, Postgres and SQlite), that's definitely not enough. Caches (like Redis), message brokers (traditional and log base like Kafka, etc.). In the real live application those are important points. I guess one can use some C/C++ bindings, but, again, this is not convenient. "A Crystal program executes in a single operating system thread" I guess this could be performance issue if someone wants to write server in Crystal. Developers are "spoiled", having cool type system would not make language popular. That's kind of egg and chicken problem for each new language. It is hard to start from building large ecosystem for an almost unknown language. Hard to afford this. That's why Go or Kotlin got popular - Go had a huge Google backing and funding, Kotlin found a good niche (better Java for Android phones), has a dev tooling company behind it and has all the Java ecosystem as a backup. Ruby, on the other hand, got at some point "killer application" - Rails that solved big pains of web development. I don't see how Crystal can fit any of those success scenarios.
- regularfry 5y agoAll that means is that it's not (yet) going to be a mass-market language. That's fine, not everything needs to be. Ruby wasn't mass-market until, like you said, it got a killer application. All Crystal needs to do is prove itself useful to people long enough for a killer application to emerge, and the rest sorts itself out. You're strongly overplaying the importance of having an IDE; neither node.js nor Ruby had a strong contender there when they became popular, and I'd argue Python didn't either - at least not one successful enough that you could point to it as unblocking a popularity bottleneck. Integrations: it's got an FFI system and a dependency management system (in Shards); again, those will sort themselves out if they haven't already. Not everyone has to go through the hassle of wrapping a C library, it's enough for one person to do it and publish their work. Although for some reason our corporate network seems to blanket-block the TLD, so I can't check out how good the crystalshards.xyz selection actually is. The reasons why some things become popular and others don't are complicated and usually not what people think, and the route one language took to popularity isn't necessarily the only one. But then again, mass-market popularity isn't the only worthwhile goal.