News:

Facebook killed the radio star. And by radio star, I mean the premise of distributed forums around the internet. And that got got by Instagram/SnapChat. And that got got by TikTok. Where the fuck is the internet we once knew?

Main Menu

A few changes..

Started by Joe, August 21, 2011, 01:55:06 AM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

Joe

Hello!

If you follow me on twitter, you certainly know that I was at a Ruby conference these past few days. As yesterday was Whyday, I decided to remove the ant build script and replace it with rake. This means two things:

  • Install JRuby, or you can't build JavaOp anymore.
  • Builds are a lot more awesome.

The ant script ran clean,build,jar on my MacBook Pro in about 8 seconds. Rake runs clean,build,jar in just under 13. You're probably thinking, "whytf did you do that, then?". Most of the startup time for rake with JRuby is loading a JVM (and using standard rake isn't an option for building Java projects). There's a neat project called Nailgun that keeps a server JVM running in the background. By typing 'jruby --ng-server &', you'll start up a Nailgun server, and then run 'jruby --ng -S rake clean build jar'. This still takes 13 seconds. However, JVM has been optimizing the compiler. Running it again only takes 7 seconds, so the ant script is outperformed after only two runs. The next takes 5 seconds. Do you see a trend? It's unlikely that I'll sit down, fix a bug, test, commit and push in one build cycle, and if I do, it only cost me an extra 5 seconds in build time.

Equally important, and much more important to users, is that rake is awesome for testing. I was using JUnit before, mostly to fix some CheckRevision bugs I made by testing local hashing directly against BNLS. JUnit is a real pain. I need to download the JAR, put it in the correct place, figure out dependencies and classpaths, etc etc, and maybe it'll run. Check this out:

[00:52:48] [william@enterprise ~/Documents/Git/GitHub/javaop2]$ jruby --ng -S rake test
Loaded suite /Users/william/bin/jruby-1.6.3/bin/rake
Started
Testing D2DV..  local: 573e1c0c, remote: 573e1c0c
Testing D2XP..  local: 7264e3da, remote: 7264e3da
Testing STAR..  local: -5bab8e79, remote: -5bab8e79
Testing W2BN..  local: -3122f25d, remote: -3122f25d
Testing WAR3..  local: 32a227d6, remote: 32a227d6
Testing W3XP..  local: 32a227d6, remote: 32a227d6
.....
Finished in 1.061 seconds.

5 tests, 15 assertions, 0 failures, 0 errors


This is really neat because now every time I run rake tests, it makes sure I didn't break CheckRevision. Unit testing is a Ruby philosophy, and being adopted in a bunch of other communities. Now, if I break CheckRevision (through any means leading up to the absolute result that gets sent to BNET), I'll be immediately notified. I'm sure this makes rabbit very, very happy.

Happy JavaOping.
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Sidoh

Unit testing is a lot older than ruby...

Rake is fun and all, but I'd much rather have ant. Especially after having ivy. Maybe rake plays well with ivy, but i kinda doubt it's as seamless as it is with ant.

Joe

Quote from: Sidoh on August 21, 2011, 01:54:02 PM
Unit testing is a lot older than ruby...

Yeah, but Rubyists and Railers do it at least 100x as much as anyone else.
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Sidoh

Quote from: Joe on August 21, 2011, 02:15:38 PM
Quote from: Sidoh on August 21, 2011, 01:54:02 PM
Unit testing is a lot older than ruby...

Yeah, but Rubyists and Railers do it at least 100x as much as anyone else.

This is patently false in general, but maybe true in open source. "Unit testing is a Ruby philosophy" makes it sound like ruby folks are the originators of unit testing, which is clearly false.

I like ruby as much as the next guy, but it really sucks for a lot of things.

Joe

Quote from: Sidoh on August 21, 2011, 03:09:36 PM
Quote from: Joe on August 21, 2011, 02:15:38 PM
Quote from: Sidoh on August 21, 2011, 01:54:02 PM
Unit testing is a lot older than ruby...

Yeah, but Rubyists and Railers do it at least 100x as much as anyone else.

This is patently false in general, but maybe true in open source. "Unit testing is a Ruby philosophy" makes it sound like ruby folks are the originators of unit testing, which is clearly false.

I like ruby as much as the next guy, but it really sucks for a lot of things.

I should say "most Rubyists and Railers unit test absolutely everything whereas others don't", and "unit testing is an agile programing philosophy, which is used heavily in Ruby". Of course, agile was only adopted by Ruby after the Rails-era began and was itself originated elsewhere, but the point is that I was introduced to agile and unit testing by rubyists and that's where I see it's primary use today.

I'm curious what things Ruby sucks for. I agree that it's terribly outperformed by {insert any other language here} when run on MRI, but with JRuby, or especially JRuby + Nailgun, it's deadly fast.
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Sidoh

Quote from: Joe on August 21, 2011, 04:20:23 PM
Quote from: Sidoh on August 21, 2011, 03:09:36 PM
Quote from: Joe on August 21, 2011, 02:15:38 PM
Quote from: Sidoh on August 21, 2011, 01:54:02 PM
Unit testing is a lot older than ruby...

Yeah, but Rubyists and Railers do it at least 100x as much as anyone else.

This is patently false in general, but maybe true in open source. "Unit testing is a Ruby philosophy" makes it sound like ruby folks are the originators of unit testing, which is clearly false.

I like ruby as much as the next guy, but it really sucks for a lot of things.

I should say "most Rubyists and Railers unit test absolutely everything whereas others don't", and "unit testing is an agile programing philosophy, which is used heavily in Ruby". Of course, agile was only adopted by Ruby after the Rails-era began and was itself originated elsewhere, but the point is that I was introduced to agile and unit testing by rubyists and that's where I see it's primary use today.

I'm curious what things Ruby sucks for. I agree that it's terribly outperformed by {insert any other language here} when run on MRI, but with JRuby, or especially JRuby + Nailgun, it's deadly fast.

Unit testing is incredibly common in a majority of software companies. The startup I just finished interning with had just as much test coverage for Java projects as it did for its Rails projects.

Weakly typed languages cause all sorts of trouble in bigger software projects.  If I'm doing something in cascading/mapreduce, I'd never wish the ability to do it in ruby. Fuck that.

Joe

I just rewrote CheckRevision in Ruby, and man oh man did I wish I had int64's instead of just BigNum / FixNum. Having to do:

a = a & 0xffffffffffffffff
b = b & 0xffffffffffffffff
c = c & 0xffffffffffffffff


...after every iteration of the loop, yikes.

I need to commit that code at some point. I like the way I did it. I used blocks, kind of how MyndFyre dynamically emitted his version, but except not. I defied a block for each action ("A=A+S", etc) and fire each of the blocks on each iteration. I need to do an actual speed test to see if it's faster than the old structure.

For those curious, it does a StarCraft CheckRevision in ~3.6 seconds on MRI, or ~1.8 on JRuby on Nailgun (5th run).

EDIT -
And for those also curious, it's not replacing CheckRevision in JavaOp. I'm thinking about rewriting JBLS (RBLS?) to work better in low-memory situations. It may just be much better to keep a CheckRevision worker running in Java and cache results in ActiveRecord, though.
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


MyndFyre

Can't Ruby consume C libraries?  It seems like it might be faster to do something like that...

Quote from: Joe on September 05, 2011, 04:27:42 AM
man oh man did I wish I had int64's instead of just BigNum / FixNum.
Yeah, I don't like this trend in scripting languages to limit the kinds of numbers that you can have.  JavaScript is terrible about that... there's no good currency-based math.  Best thing you can do is multiply everything by 100, finish your math, and divide by 100 when you're done. 

Quote from: Joe on August 21, 2011, 02:15:38 PM
Quote from: Sidoh on August 21, 2011, 01:54:02 PM
Unit testing is a lot older than ruby...

Yeah, but Rubyists and Railers do it at least 100x as much as anyone else.
I've heard you say a lot of retarded things, Joe, but this is easily the most retarded of the last year or so.
Quote from: Joe on January 23, 2011, 11:47:54 PM
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Quote from: Rule on May 26, 2009, 02:02:12 PMOur species really annoys me.

Joe

Quote from: MyndFyre on September 05, 2011, 12:40:05 PM
Quote from: Joe on August 21, 2011, 02:15:38 PM
Quote from: Sidoh on August 21, 2011, 01:54:02 PM
Unit testing is a lot older than ruby...

Yeah, but Rubyists and Railers do it at least 100x as much as anyone else.
I've heard you say a lot of retarded things, Joe, but this is easily the most retarded of the last year or so.

How so? Perhaps I should have said "People in the Ruby/Rails culture", or "open source developers in the Ruby/Rails culture". Nobody from a different programming background would ever write a sonnet about testing and present it at a conference, or would you?
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Sidoh

Quote from: Joe on September 05, 2011, 02:01:35 PM
Quote from: MyndFyre on September 05, 2011, 12:40:05 PM
Quote from: Joe on August 21, 2011, 02:15:38 PM
Quote from: Sidoh on August 21, 2011, 01:54:02 PM
Unit testing is a lot older than ruby...

Yeah, but Rubyists and Railers do it at least 100x as much as anyone else.
I've heard you say a lot of retarded things, Joe, but this is easily the most retarded of the last year or so.

How so? Perhaps I should have said "People in the Ruby/Rails culture", or "open source developers in the Ruby/Rails culture". Nobody from a different programming background would ever write a sonnet about testing and present it at a conference, or would you?

The problem is it's just wrong. Companies have been hiring software testers for decades. In case that's not clear, that means there are people who have full time jobs writing tests.

Newby

Quote from: Sidoh on September 05, 2011, 02:17:35 PM
Quote from: Joe on September 05, 2011, 02:01:35 PM
Quote from: MyndFyre on September 05, 2011, 12:40:05 PM
Quote from: Joe on August 21, 2011, 02:15:38 PM
Quote from: Sidoh on August 21, 2011, 01:54:02 PM
Unit testing is a lot older than ruby...

Yeah, but Rubyists and Railers do it at least 100x as much as anyone else.
I've heard you say a lot of retarded things, Joe, but this is easily the most retarded of the last year or so.

How so? Perhaps I should have said "People in the Ruby/Rails culture", or "open source developers in the Ruby/Rails culture". Nobody from a different programming background would ever write a sonnet about testing and present it at a conference, or would you?

The problem is it's just wrong. Companies have been hiring software testers for decades. In case that's not clear, that means there are people who have full time jobs writing tests.

So Ruby developers are the first developers to test their programs? lol. lol x like 10.
- Newby
http://www.x86labs.org

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote from: Rule on June 30, 2008, 01:13:20 PM
Quote from: CrAz3D on June 30, 2008, 10:38:22 AM
I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

deadly7

Quote from: Sidoh on September 05, 2011, 02:17:35 PM
The problem is it's just wrong. Companies have been hiring software testers for decades. In case that's not clear, that means there are people who have full time jobs writing tests.
That sounds like the worst computer-related job I could ever think of.
[17:42:21.609] <Ergot> Kutsuju you're girlfrieds pussy must be a 403 error for you
[17:42:25.585] <Ergot> FORBIDDEN

on IRC playing T&T++
<iago> He is unarmed
<Hitmen> he has no arms?!

on AIM with a drunk mythix:
(00:50:05) Mythix: Deadly
(00:50:11) Mythix: I'm going to fuck that red dot out of your head.
(00:50:15) Mythix: with my nine

Sidoh

Quote from: deadly7 on September 05, 2011, 07:20:01 PM
Quote from: Sidoh on September 05, 2011, 02:17:35 PM
The problem is it's just wrong. Companies have been hiring software testers for decades. In case that's not clear, that means there are people who have full time jobs writing tests.
That sounds like the worst computer-related job I could ever think of.

Maybe for you... some people like it.

MyndFyre

Quote from: Joe on September 05, 2011, 02:01:35 PM
How so? Perhaps I should have said "People in the Ruby/Rails culture", or "open source developers in the Ruby/Rails culture". Nobody from a different programming background would ever write a sonnet about testing and present it at a conference, or would you?
I've seen a lot of people do a lot of weird things at a conference.  But another way to consider the example of someone writing a sonnet about testing in Ruby is that the Ruby tester didn't have enough other, productive things to do with his time.

More to the point, while he was writing sonnets about testing, I was writing a C# unit test that unit-tested the JavaScript for the updates GoDaddy is rolling out on my product around the end of the month.  38 tests for something like 120 lines of code.  And it turned out - lo and behold - that the unit tests found two bugs in my JavaScript.  People realized the value of unit testing well before Ruby was the little thought-sperm in Yukihiro Matsumoto's brain.

Quote from: deadly7 on September 05, 2011, 07:20:01 PM
Quote from: Sidoh on September 05, 2011, 02:17:35 PM
The problem is it's just wrong. Companies have been hiring software testers for decades. In case that's not clear, that means there are people who have full time jobs writing tests.
That sounds like the worst computer-related job I could ever think of.
I thought it was odd too, but we have a dedicated QA department at GoDaddy and most of them are not programmer-level technical people in the least.  http://www.joelonsoftware.com/items/2010/01/26.html
Quote from: Joe on January 23, 2011, 11:47:54 PM
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Quote from: Rule on May 26, 2009, 02:02:12 PMOur species really annoys me.

Sidoh

People like breaking stuff. They're the kids that liked kicking sandcastles.