News for hackers. Stuff that matters.
Re:Ruby 2.4.0-preview1 released by danso on Tuesday June 21, 2016 @10:34AM (#11945873)
I've spent the past couple weeks thinking about what framework I want to use to build static sites. I've primarily used Middleman, or Jekyll when working with collaborators (think of Middleman as Jekyll but with no restrictions -- i.e. You don't have to use Liquid and you can write plain old Ruby objects and include them as with a typical full-stack app).

I used to do Ruby because of Rails work...now I do my work exclusively in Python and Node. I thought it'd be worthwhile to move to a new framework just so I don't have to juggle so many languages on a daily basis. Lektor (Python) is exciting and I'll check it out as a way to build client sites...but it's not quite as flexible as Middleman (to be fair, Lektor is very new)...Pelican looks good as well...but for now, I think Middleman hits the perfect spot for speed of deployment and hackability (it recently extricated itself from sprockets so that you can incorporate webpack.js or whatever asset build system you like), even accounting for Middleman's and Ruby's slow speed of execution versus the hugely popular Hugo (static framework in Go)

The truth of it is, is that once you've picked up Ruby, nothing feels quite as nice as a scripting glue language. I haven't kept up much with updates to the language...all I know is that yesterday, I finally updated my Ruby environment manager (rbenv)...it had been 2 years...and changed my system Ruby to 2.3.1 (from 2.1.5)...I had to update a few version numbers for dependencies, but otherwise, all of my old projects worked with barely a hitch...and it took me no time to get into writing custom plugins for my next Middleman site.

It does seem that the excitement over Rails and Ruby has ebbed, if you look at Github stats and Stackoverflow's latest survey. I am curious to see where the language can go from here, or how it can make a strong niche for itself besides Rails. but of all the "old" languages that I sometimes have to come back to, Ruby has been the most welcoming.

Re:Ruby 2.4.0-preview1 released by skewart on Tuesday June 21, 2016 @11:04AM (#11946126)
> The truth of it is, is that once you've picked up Ruby, nothing feels quite as nice as a scripting glue language.

I today agree. Ruby is amazing as a light scripting language - heck, I think it's pretty great as an all-around language, but quick glue scripts are where it really shines.

I wouldn't be sad to see it fade in popularity if it weren't for the fact that the language(s) and/or ecosystems eclipsing it are so, well, lame. For a profession that demands so much careful, reasoned thought software engineers as a whole can be incredibly irrational.

Re:Ruby 2.4.0-preview1 released by CGamesPlay on Tuesday June 21, 2016 @12:29PM (#11946927)
> the language(s) and/or ecosystems eclipsing it are so, well, lame. For a profession that demands so much careful, reasoned thought software engineers as a whole can be incredibly irrational.

How do you reconcile an unsupported "lame" without being "irrational"? Do you have technical reasons they're lame?

Re:Ruby 2.4.0-preview1 released by skewart on Tuesday June 21, 2016 @01:07PM (#11947323)
Haha, good point.

I don't have time to go into much depth right now, but basically the ascendent languages don't seem to offer many compelling technical advantages. For example, I've yet to hear a compelling reason why JS makes a better serverside language than Ruby for most use cases. To be fair, Node and some of the JS libraries for a long time offered advantages over the Ruby ecosystem for things like websockets (EventMachine used to swallow stack traces in a really annoying way). But that has more to do with the ecosystem than the languages themselves.

I think part of the problem had to do with how dominant Rails was/is in Ruby. I wish a framework that better catered to emerging app design trends had gotten traction in Rubyland in, say, 2012.

As for specific complaints about JS, well, it's a perfectly fine language, but I don't think it's an improvement in any way over Ruby. It has a number of quirks and compromises - prototype inheritance, basically no support for modules, clumsy typing, to name a few - which people have been patching over and working around in lots of different ways over the years. You end up with a forest of different solutions to things that wouldn't have been a problem in other languages. Now some fairly dramatic changes are being introduced, which is probably good, but it means the ecosystem is even more complicated. Working with the JS ecosystem feels like working with a poorly maintained legacy codebase - there are lots of places where people have come up with workarounds to things that shouldn't have been a problem in the first place; it makes you tired just thinking about all the mental energy spent solving all the little unnecessary problems.

Re:Ruby 2.4.0-preview1 released by mark_l_watson on Tuesday June 21, 2016 @01:36PM (#11947610)
I agree. I am happy writing code in Ruby: NLP stuff, Sinatra light weight web apps, and short text handling utilities.

I also use Haskell, Java, Common Lisp, and Clojure (and Python for machine learning libraries) but I am happiest working in Ruby.

Re:Ruby 2.4.0-preview1 released by igravious on Tuesday June 21, 2016 @03:56PM (#11948931)
How do you do NLP stuff in Ruby? I thought Python was the go-to dynamic interpreted language for that work what with recent efforts by SpaCy and of course NLTK modules and Sci.py and Num.py ? What do you know that I don't. I'd love to be able to do stylometrics/topic-modelling/part-of-speech analysis/word vectors/… in Ruby -- please show me the way :)
Re:Ruby 2.4.0-preview1 released by mark_l_watson on Tuesday June 21, 2016 @06:13PM (#11949868)
I have a live demo: http://kbsportal.com

Edit: however, stick with Python for deep learning NLP, and NLTK works well and is exceedingly well documented.

Re:Ruby 2.4.0-preview1 released by igravious on Tuesday June 21, 2016 @07:14PM (#11950235)
Thanks!
Re:Ruby 2.4.0-preview1 released by geraldbauer on Tuesday June 21, 2016 @02:34PM (#11948173)
> how it can make a strong niche for itself besides Rails.

You anwered your own question ;-) Ruby works great for static (web)sites including books, presentations, etc and for all kind of "text" and "small data" processing. Not sure if Jekyll is already the "new Rails" - for example, I've put together a Jekyll theme site called Dr. Jekyll's [1] listing more than 100+ themes. I've also started a bookshelf (imprint) called Yuki & Moto Press [2] for books on Ruby published with Jekyll (and Octobook). Cheers. [1] http://drjekyllthemes.github.io [2] http://yukimotopress.github.io

Re:Ruby 2.4.0-preview1 released by weatherlight on Tuesday June 21, 2016 @11:21AM (#11946307)
Elixir is simply the first language since Ruby to really care about code beauty and UX of the language, libraries and ecosystem.

I can't recommend Phoenix and Elixir enough.

Re:Ruby 2.4.0-preview1 released by zem on Tuesday June 21, 2016 @04:54PM (#11949330)
elixir looks awesome, but there's no need to overstate its case - tons of languages really cared about beautiful code and a pleasant ecosystem. clojure was perhaps the best in that respect; there was a lot of effort made to have consistent and pretty libraries. f# seems like it's shaping up nicely too, though it still has some rough edges (but then again, so does ruby!). pyret does "beautiful code" even better than ruby does; if it had a good command line implementation and ecosystem it might have been my new favourite scripting and general-purpose language by now. elm puts a lot of love and effort into both the language and the libraries, and in particular has some of the most user-friendly error messages i've ever seen. and that's just the languages i'm familiar with; i'm sure others can chime in with lots more.
Re:Ruby 2.4.0-preview1 released by igravious on Tuesday June 21, 2016 @04:00PM (#11948966)
This sentiment is being repeated over and over and one can't help but notice it. But I'm really really really reluctant to switch from Ruby for yet another language/ecosystem unless it were to something industrial-strength like Haskell. What is so amazing about Elixir?
Re:Ruby 2.4.0-preview1 released by careersuicide on Tuesday June 21, 2016 @10:32PM (#11951174)
As a long time Rubyist here's a brief rundown of the features Elixir has that made me reach for it with increasing frequency:

* Pattern matching: http://elixir-lang.org/getting-started/pattern-matching.html

* Guard clauses in function definitions: http://elixir-lang.org/getting-started/case-cond-and-if.html...

* Macros: http://elixir-lang.org/getting-started/case-cond-and-if.html...

* The |> operator: http://elixir-lang.org/getting-started/enumerables-and-strea...

For me those really are the killer features for Elixir. I know most people will point to Elixir's support for concurrency and the whole GenServer thing that it gets from Erlang when discussing why Elixir is interesting. And those aspects of the language/ecosystem really are awesome. But being able to nearly eliminate explicit conditionals with guard clauses is just so damn cool I can barely stand it. And the |> operator is something I desperately wish Ruby had. I like Elixir a lot because it seems to put a huge emphasis on making my job as a programmer suck less without sacrificing other things in the process.

Re:Ruby 2.4.0-preview1 released by sergiotapia on Tuesday June 21, 2016 @11:03AM (#11946112)
Try Phoenix with Elixir. Really similar to Rails with Ruby on the surface, and surface similarities are all you will really worry about for static pages.

Views (called Templates in Phoenix) are compiled as strings and cached by the CPU automatically so you get really nice scaling out of the box, with no effort on your part.

Re:Ruby 2.4.0-preview1 released by joshmn on Tuesday June 21, 2016 @03:49PM (#11948901)
It's similar to Rails in Rails' ideas, but not in its ecosystem. The most powerful thing of Rails is not MVC, or convention over configuration, but the vast, vast ecosystem.
Re:Ruby 2.4.0-preview1 released by sergiotapia on Wednesday June 22, 2016 @03:49AM (#11952174)
For static pages that is kind of irrelevant though.
Re:Ruby 2.4.0-preview1 released by sdegutis on Tuesday June 21, 2016 @11:08AM (#11946170)
> I thought it'd be worthwhile to move to a new framework just so I don't have to juggle so many languages on a daily basis.

That's actually a big reason we use Clojure at work for our web app: the only language we use is Clojure, from beginning to end.

Re:Ruby 2.4.0-preview1 released by eric-hu on Tuesday June 21, 2016 @02:10PM (#11947967)
Honest question: how can you stand the JVM start up time and the terrible stack traces?

I find myself wishing there were a clojure not on the JVM (or on javascript)...pretty much I think I'd be happier with another lisp, but I'm not sure.

Re:Ruby 2.4.0-preview1 released by sdegutis on Tuesday June 21, 2016 @06:53PM (#11950122)
Good question.

At the beginning of my work day, I open Emacs with Cider installed, and start a JVM inside there using Cider (M-x cider-jack-in), and do all my work in the same JVM all day.

Because we make heavy use of immutability, it's easy to completely tear down all our existing namespaces and the single global variable representing the app, reload all namespaces and their functions, recreate a new app instance, and start it. And I bound all this to Cmd-R in Emacs.

So any time I make a change to our web app during development, I just hit Cmd-R and it reloads the entire app in about 0.2 seconds. I don't even notice it, honestly.

This is better than what we used to do, which was to poll the disk for changes to any files, and reload them when they've changed. That was much harder on the disk, and half the time I'm saving, I'm not ready for its code to be reloaded yet anyway.

For tests, we just use Cider's built-in features, which let us either run the tests whose code changed, or all tests, depending on what we want to test.

Re:Ruby 2.4.0-preview1 released by JBReefer on Tuesday June 21, 2016 @09:07PM (#11950877)
thanks for the write up, real work examples are so useful!
Re:Ruby 2.4.0-preview1 released by chc on Tuesday June 21, 2016 @03:17PM (#11948599)
JVM startup time is kind of annoying, but doesn't seem like a very big problem. You can use drip or nailgun to avoid dealing with it most of the time.
Re:Ruby 2.4.0-preview1 released by danso on Tuesday June 21, 2016 @11:21AM (#11946296)
That's definitely on my list, at least to learn it for expanding my knowledge of language design. It's hard to imagine moving away from Python and all of its scientific packages.

(I really do hope I never have to build another full-stack web app, either in Rails, Django, or whatever...unless it's to put food on the table)

Re:Ruby 2.4.0-preview1 released by 33degrees on Tuesday June 21, 2016 @11:54AM (#11946630)
I can relate. As I find myself doing more front-end work, it seems natural to be using JS on the backend as well, but I simply don't enjoy it as much. Not just the language, but the design and UX of all the popular libraries as well.