6 ms·
Crystal 0.28.0 Released
- dingdingdang 7y agoOdd, I've really enjoyed seeing Crystal develop but this latest release adds so many features that it feels like the language might fall off my radar again - too much complexity!
- CaptainHiggins 7y agoJust because the features exist does not mean you have to use them.
- jstimpfle 7y agoJust because you don't use features does not mean they don't add complexity when you're trying to understand some piece of code, or when you're trying to design a piece of code that should interact with other code. (Not taking sides about this language's complexity; I don't know the language)
- recursive 7y agoJust because you don't use them doesn't mean someone else won't.
- binarycrusader 7y agostares in C++; stares in Perl But seriously, I think C++ and Perl have taught us that if you give programmers the logical equivalent of a Swiss Army Knife, they will use/abuse absolutely every single bit of it to write their programs. I used to be a big fan of "more than one way to do it", but these days, I'd gladly take "one reasonably clear way to do it that not everyone likes but 'everyone' can live with".
- sosodev 7y agoI don't think it's that simple. C++ has a lot of features whose syntax have little consistency. Ruby has a lot of features but they all feel reasonably thought out. The language still feels quite elegant.
- binarycrusader 7y agoObviously, it's not that simple. But my suppositions are a response to the statement Just because the features exist does not mean you have to use them. There is a cost to functionality that exists in a language and you can't just ignore it because someone will use it and you will still need to understand it. Although I don't personally like the Go language, I can empathize and understand the reasoning behind its strong, opinionated language choices. Go is a perfect example of doing things in a way that not every one likes, but "everyone" can live with, just like gofmt.
- Twirrim 7y ago> I used to be a big fan of "more than one way to do it" I used to firmly believe that that was the way a programming language should be. Let me do what I want to do, however I want to do it. I've finally found myself falling in to almost the complete opposite, with a small addition: "There should be one way to do it, and it should be obvious" Python mostly scratches that itch for me, but even there it has multiple methods to do the same stuff within the standard library, like list.sort() and sorted(list) https://medium.com/@DahlitzF/list-sort-vs-sorted-list-aab92c00e17 https://medium.com/@DahlitzF/list-sort-vs-sorted-list-aab92c...
- ryl00 7y ago> Python mostly scratches that itch for me, but even there it has multiple methods to do the same stuff within the standard library, like list.sort() and sorted(list) There's also the list vs tuple thing. I can understand it from an efficiency point of view, but it isn't as consistent as just having one such data structure (e.g., a perl array)
- silly_giraffe 7y ago>same stuff within the standard library, like list.sort() and sorted(list) Those have different use cases. `sorted` is for situations where you would use a list comprehension and immediately consume the result vs `.sort` where you need the iterable sorted for future use. As a quick scribble, you can do something like the following to sort random numbers in a single line: result = sorted(random.random() for x in range(10)) From your Medium post: def list_sort(arr): return arr.sort() def sorted_builtin(arr): return sorted(arr) Only the `sorted_builtin` function returns the array, `list_sort` returns None. The `list_sort` function would have to become: def list_sort(arr): arr.sort() return arr Edit: goofed the formatting
- pull_my_finger 7y agoCome to the Lua side and learn to enjoy "mechanisms over policy" "...A fundamental concept in the design of Lua is to provide meta-mechanisms for implementing features, instead of providing a host of features directly in the language. For example, although Lua is not a pure object-oriented language, it does provide meta-mechanisms for implementing classes and inheritance. Lua's meta-mechanisms bring an economy of concepts and keep the language small, while allowing the semantics to be extended in unconventional ways."
- newnewpdro 7y agoJohn Carmack said it well when he said something to the effect of "everything that is syntactically correct eventually makes it into the codebase". But I have no opinion of Crystal, just prefer small, concise languages in general.
- mirekrusin 7y agoWhat are you talking about?
- Jenz 7y agoRecently, all new Crystal releases has introduced only new features for very specific use-cases, or made old ones easier or better to use. For example the new "begin-less and end-less ranges" — unless you need such a thing; there is no need to use it, or give it any care alltogether.
- jscholes 7y ago> This is a big release that includes ... important changes for the much awaited ... windows features. Then the article doesn't say another word about Windows.
- burky 7y agoI know right. But he addresses it in the comments at the bottom of the article.
- ternaryoperator 7y agoLooking at the comment, I can't figure out what he says about it running on Windows.
- wiremine 7y agoI've been meaning to kick the tires on Crystal, but haven't find the right project yet. Would be curious to hear how people like using it.
- jeremycw 7y agoI think it's great. If you're a fan of Ruby it's hard not to like. I'd say it competes with go in many respects. If Ruby is your daily driver crystal is perfect for cases where you need more performance or where non blocking io would be a good fit.
- viraptor 7y agoOr where you want to deploy some small tools without worrying about setting up rbenv and dealing with bundler in your config management.
- mark_l_watson 7y agoThanks, I have wanted to try it. I will find some small project to use Crystal for.
- bks 7y agoWe are using Crystal for our mail flow monitoring tool at mailflowmonitoring.com - create a free account and you can check it in action. It was a delight to deal with. We also created a Crystal email parser - https://github.com/amrood-labs/mail.cr https://github.com/amrood-labs/mail.cr
- furi 7y agoI've written a couple things in it, mostly little web servers that serve a questionnaire or something, more recently a Lisp and a rudimentary voice chat. I really really like it. Compared to the languages I'm coming from (C/C++ mostly, some Python & C#) the compile time checking is unparalleled. I frequently find that once I've fixed all the compile time errors the program works first time, something I've never experienced in any other imperative language. The standard library is nice too. It's still missing a couple things, for example hash functions better than SHA1 must be accessed by providing their string names to the OpenSSL module at the moment, but overall it's well designed and miles ahead of C/C++ in functionality. My main gripe is the state of Windows support, it works in the Linux subsystem but I spent three hours trying to work out how, for my voice chat program it involved: 1. Turning on something in PowerShell. 2. Installing something from the Windows store. 3. Adding a new repository to Apt. 4. Installing Crystal and all the dependencies of your application. 5. Compiling your application. 6. Installing PulseAudio for Windows. 7. Connecting PulseAudio for Windows to Linux somehow. (I gave up upon opening the guide for how to do this bit). Hardly a process an end user can be expected to do.
- rarrrrr 7y agoBeen using Crystal on a project that would've been written in basic Ruby.. productivity is amazing. And it has generics! :D https://play.crystal-lang.org/#/r/6r3e https://play.crystal-lang.org/#/r/6r3e How to get Crystal 0.28.0 on macOS right now! : brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/ca8f21cd49a936bf154235b365fa23929f9f688d/Formula/crystal.rb # or: brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/ca8f21cd49a936bf154235b365fa23929f9f688d/Formula/crystal.rb # start the local playground crystal play &; open http://127.0.0.1:8080
- gulabjamun 7y agoHow much does the syntax differ from ruby ? Do you think I should learn crystal by porting a smallish ruby CLI app to it, or make one from scratch porting a small bash app ? I was thinking of doing it in `go` or `rust` but thinking of crystal after seeing this article.