Happens in a lot of languages - Ruby pissed me off a while ago with the 1.9.1 to 1.9.2 upgrade.
Before you could write:
require 'libs/mylib'
Now it's
require './libs/mylib'
They cited security for it, but the first example was valid and it became invalid. Easy enough to fix, but still annoying as hell.
It's documented in the FAQ:
http://www.ruby-lang.org/en/news/2010/08/18/ruby-1-9.2-released/
While I suppose the reasoning for that change was valid, it was an annoying fucking change that I had to track down.
Happens all the time in all languages...
He mentions (and dismisses) D indirectly.
>I was a bit skeptical when I read about Google's new programming language. I simply ignored the news. After all, the next New Great Language is just around the corner. Some of them enjoy a phase of hype, but then fade again^Ruby, others stay in the spheres of irrelevancy^D, while yet others will be ready for public consumption any decade now^Perl6.
I'm a fan of the Programming Ruby book, although I think the koans are a much better way of learning the language - programming ruby
There's a pretty good list of projects using ruby on the ruby website at ruby projects
There's also a lot of places using rails rails examples
edit: Fixed links
I'm a ruby fan and sad to say, you're wrong.
http://www.ruby-lang.org/en/news/2009/01/30/ruby-1-9-1-released/
Most of us treated it like a preview release, but that's not how it was announced to the world.
First of all, Computer Science and Computer Engineering are two very different fields. I'm not aware of any degree called Computer Science Engineering. Basically, CS involves a lot of computer programming, as well as a lot of the mathematical theory behind programming, such as the analysis of algorithms, the theory of programming languages, etc. Computer Engineering deals with how computers actually work at the hardware level, although CEs do have to take some of the programming courses that CS majors do.
As long as you enjoy programming, you should enjoy doing a CS degree, although it helps if you enjoy some of the math you'll be exposed to as well (have you ever done proofs in any of your math classes before? Did you enjoy them?). If you've never done programming before, try messing around with a language like Python or Ruby for a little while to get a feel for it.
Technically, it was announced as the first stable version of Ruby 1.9. A lot of software was updated for compatibility purposes with 1.9.1, but until the 1.9.2 series most seemed to ignore it for production.
Wonder why you're gettin' the down-votes. Just came to say, if you want to play with a super-object-oriented-language, give Ruby a go. Not saying it's the best language in the world, but it was my first experience. I think it has a lot of value in scripting and learning fundamentals. Also, they have an online interactive console and tutorial that you can play with at their site.
To be fair, he probably knows, at least intuitively, that an "integer allocation" is this abstract PyInt
or PyLong
thing which is an expensive operation.
I think many python programmers would be horrified to know how much code is behind the curtain. But this is the case pretty much everywhere.
You can try the 20 minute Ruby programming tutorial:
http://www.ruby-lang.org/en/documentation/quickstart/
Ruby is a really simple language but its very different from the more traditional languages like C, C++, C#, Java, etc. I would suggest you learn ruby but focus more on the concepts than on the language's syntax itself
Seriously: if you're learning to program right now, just learn ruby. It's a fun and beautiful language, and I really mean that it's beautiful. But security is something you'll learn more through learning about things like buffer overflows, and that's something you'll learn in C. Reading http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-4124 is mystical and hard only knowing a language like Ruby where memory is managed for you, but it makes complete sense from the point of view of C.
In the meantime, read http://www.ruby-lang.org/en/security/ regularly for a start and good luck to you!
The Ruby mailing list is quite active. http://www.ruby-lang.org/en/community/mailing-lists/
Specifically the Ruby-Talk list. A good place to ask questions if you have any and help out if you can!
Yeah... VIT also seems to lack direction. Back when everyone was trying to re-build ruby-lang.org, many good attempts were made. I even ported the entire ruby-lang.org site into a Jekyll site. VIT eventually created a new ruby-lang.org, but none of the other attempts were merged in and developed seems to have stopped.
You can learn both at the same time. Ruby is a programming language, so you're learning how to program. Join a good community to stay motivated. Seek out Ruby/Ruby on Rails user groups in your area. If you're feeling demotivated, stay put! Google anything you don't understand. Programming is hard to learn because you can't relate it to what you know. Trust me, I was the same way about a year ago.
If you have any more questions, there's always Reddit. :)
Are you talking about taking the ruby spec and writing your own interpreter for ruby?
I remember seeing a court ruling that says programming languages are not copyrightable.
If you're looking at embedding an existing interpreter into your program, it is likely that it is GPL or LGPL.
Here is a site which talks about embedding ruby into your C++ programs.
A cursory reading of the ruby LICENSE.TXT shows that you can take the ruby code and modify it and so long as you don't call it ruby anymore, you're good to go. However, it looks like the code used in the regexp module is under the LGPL so you'll need to dynamically link to a ruby runtime unless you want to contaminate your code with LGPL.
Related: read Manning's Well Grounded Rubyist for more on this stuff. Also, you could download the source and look under class.c for all the relevant C code for MRI mentioned in that video.
I haven't made this the most non-programmer-friendly yet, sorry about that.
You'll need to install Ruby 1.9 (http://www.ruby-lang.org/en/downloads/) and then you can simply run gem install minecraft
in a terminal. Right now this requires OS X or Linux. You can PM me for further help!
I wouldn't use URI, it won't parse some URIs (I can't remember which but since I moved to addressable a couple of years ago I haven't had any problems). The Addressable gem is way better and much more standards compliant. It's API is fairly similar to URI:
require 'addressable/uri' uri = Addressable::URI.parse("http://www.ruby-lang.org/") puts uri.host
zzyzzyxx is probably correct about bash being a poor example; so here are some more:
Lua : Both nil and false make a condition false; any other value makes it true
PLT Scheme (now apparently Racket): In conditional tests, all values count as true except for #f, which counts as false
Ruby : In Ruby, everything except nil and false is considered true.
For everyone saying everything being an object in Ruby is a plus, please check this stack overflow answer.
Relevant part:
> Ruby Docs - To Ruby From Python
>As with Python, in Ruby,... Everything is an object
>So there you have it from Ruby's own website: in Python everything is an object.
Have a Mac? Never programmed before?
Spotlight > "Terminal".
Type irb
and hit Enter
Type any of the following:
"How many characters are in this sentence?".length
"How many times does the letter 'e' occur in this sentence?".scan("e").length
Time.now
100.downto(1).each { |num| puts "#{num} bottles of beer on the wall, #{num} bottles of beer! Take one down, pass it around, #{num-1} bottles of beer on the wall!\n" }
You have just done some very basic Ruby tasks. :) Now Go learn some more!
Before making that jump, hopefully the programmer has read the readme and checked the public CI builds, http://travis-ci.org/#!/cldwalker/vimdb/jobs/845323 ;)
The ruby community uses 1.9 more than 1.8 now according to rubygems stats. As for 1.8.7, it'll stop getting bugfixes in a little over a year - http://www.ruby-lang.org/en/news/2011/10/06/plans-for-1-8-7/
I haven't followed the proposals, but Ruby's solution seems pretty direct.
>Our solution is to scramble the string >hash function by some PRNG-generated >random bits. By doing so a string's hashed >value is no longer deterministic. That is, >a String#hash result is consistent only >for current process lifetime and will >generate a different number for the next >boot. To break this situation an attacker >must create a set of strings which are >robust to this kind of scrambling. This is >believed to be quite difficult.
Not sure how that interacts with forked processes and such or COW (but python already has COW problems from the way ref counting works).
AFAIK perl solved these issues awhile ago, http://perldoc.perl.org/perlsec.html#Algorithmic-Complexity-Attacks
But I amnt telling you anything you don't already know, http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003/
Ruby 1.9.3 is available as RC1 (see http://www.ruby-lang.org/en/downloads/) and as pointed out by Peter Cooper on his blog (http://www.rubyinside.com/ruby-1-9-3-faster-loading-times-require-4927.html) it appears that a patch similar to Xavier Shay's was committed by Masaya Tarui a few days after. So it looks like the patch shouldn't be needed if you use 1.9.3 today, although I haven't tried lately so I am not 100% sure. I am not using 1.9.3 yet though since it's not stable yet so I don't see the point. I use 1.9.2 as default Ruby these days so for 1.9.2 you still need the patch to fix the slow startup issue.
I've begun porting the HTML from www.ruby-lang.org (a Radiant CMS site) to Jekyll. If your interested in porting legacy HTML to Jekyll/Markdown, the repository is here: https://github.com/postmodern/www.ruby-lang.org
It's been 1. for a while. 1.9 was a complete rewrite of the interpreter. It is called a "release series"
1.9.1 and 1.9.2 are simply termed releases, and 1.9.2-p180 is termed a patchlevel.
The first two digits are likely to collapse in a few years with the next major version, when 1.9. becomes 2. Then it will be more like the python numbering system. At the moment the 1 is just kind of a useless number, but still hands on because Matz thought 1.9 was too experimental to call 2 quite yet. ;-)
A good short intro would be to read To Ruby From Python, even though it is meant for people going the other way :)
I've been having a lot of fun learning to build sites on this framework: Symfony. If you know php, you can build some really cool stuff with this. It comes bundles with some incredibly useful stuff as well, making development easy enough that your brain just wants to exploit all of the capabilities.
I don't know why but something about Symfony really spurred a lot of learning and growth in my career. I've been working with it for a few months now and it has resulted in some work I'd consider really impressive even by my own standards.
Perhaps it was entirely coincidental, but it's a fun framework nonetheless. Plus there are dozens of others to play with if you're interested in frameworks, but not Symfony. I know a few people personally who like the style of development but not that particular framework. Just thought I'd throw the idea out there in case it looked interesting to you.
Ultimately, my learning is fueled by engaging new projects I find incredibly interesting. I try to have as lofty goals as possible and do whatever I can to make it happen. If the project is interesting enough, you'll be amazed how much stuff you can learn every single night.
Good luck!
edit: Rails is a framework that uses ruby and it's specifically intended to be used for web application development. Rails is the name of the framework, and it uses the model-view-controller (MVC) architecture, just like symfony does. If you want to learn something new, this would be awesome. Ruby is really cool.
Sitting at about a [6] right now.
Here is a nice tutorial, but really if you know C and BASIC, Ruby will feel pretty familiar. It was created with programmer happiness in mind, and it really shows.
Let me show you why Ruby is so awesome:
Here, I define a sting: irb(main):017:0> str = "Let's get together and feel alright." => "Let's get together and feel alright."
Ruby makes playing with strings super simple. Here, I get the length of the string, which is returned as an integer: irb(main):018:0> str.length => 36
"length" is a method that you can perform on string-like objects. Think of it like calling int length(char * str). You perform a method on a variable by using a period in between (variable.method_to_be_applied).
Here is why Ruby rocks. I'm going to get the length, convert it to a string, and chop (remove the last character from the string) it. irb(main):019:0> str.length.to_s.chop => "3"
Not cool enough? How about doing all that, THEN converting the result back into an integer, and adding 5, all in one line of code? irb(main):020:0> str.length.to_s.chop.to_i + 5 => 8
</end Ruby tutorial>
Both, actually; I'm the lead (read: only) software developer at my job as a SA (Ruby, PHP, lots and lots of shell scripting), and also like to sharpen my skills with pet projects in my spare time.
I'm not the GP, but i'll respond, cause I'd like to hear the other side.
The needle/haystack thing is a big one for me.
Ruby in particular (but also python) requires you to keep less stuff "in your head" when you're coding cause the libraries are more consistent. If I want to do an operation on an object, I can just load my REPL and query the object.methods to be reminded of what methods are available. I don't need to remember the receiving object's position in the parameter list. I can do "test".method("insert").arity to find out how many params the insert method of the string class has.
It also doesn't have the years of legacy that php has. short_open_tag? register_globals?
Ruby's built in classes are way better, even simple things like URI's are easily handled. eg. require 'uri' uri = URI.parse("http://www.ruby-lang.org/path/here/?cool=me") print uri.path
outputs "/path/here/"
in my repl, I can quickly look to see what methods are availible on the uri object;
ruby-1.9.2-p0 :017 > uri.public_methods - Object.public_methods => [:request_uri, :default_port, :scheme, :host, :port, :registry, :path, :query, :opaque, :fragment, :parser, :component, :scheme=, :userinfo=, :user=, :password=, :userinfo, :user, :password, :host=, :port=, :registry=, :path=, :query=, :opaque=, :fragment=, :hierarchical?, :absolute?, :absolute, :relative?, :merge!, :merge, :+, :route_from, :-, :route_to, :normalize, :normalize!, :select, :coerce]
notice how i'm subtracting two sets just by using the minus operator? Another great feature of ruby. I could go on for ages, but the general gist is that each of these time saving, elegant features add up to me being a happier programmer. And that counts for a lot.
After using ruby for a while, the only advantage php has for me is ease of deployment (especially for contact forms and the like).