Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Lisp and Ruby 336

sdelmont writes "The developers of Rubinius, an experimental Ruby interpreter inspired by SmallTalk, have been discussing the possibility of adding a Lisp dialect to their VM. Pat Eyler collected some ideas and opinions from the people involved and it makes for some interesting reading. For many, Ruby already is an acceptable Lisp, and the language itself started as a 'perlification' of Lisp (even Matz says so) so it is perhaps fitting and might help explain why the whole idea feels right. Now, if someone added support for VB and gave it the respect it deserves, the world would be a better place."
This discussion has been archived. No new comments can be posted.

Lisp and Ruby

Comments Filter:
  • by thanasakis ( 225405 ) on Sunday January 14, 2007 @09:50AM (#17601978)
    I am not trying to start a holy war thread about perl vs ruby, just looking for someone that can enlighten me regarding the following question.

    Having perl as it is, what are the reasons to take a look at ruby. Mind you, I am not saying that these reasons do not exist, I guess I was just lazy to find it out by myself and then again, nobody has yet offered any compelling reason. I have taken a good look at ruby, clean syntax and all, but really I couldn't find something really compelling.

    An interesting phenomenon is that most stuff that people perceive as a reason to go to ruby from perl, are available in perl too, but somehow they offer those stuff an novel.

    Please don't take me the wrong way, I can testify that ruby is indeed a kick ass piece of work, I am trying to find real reasons to use it along side with perl.

    So, fire away your opinions!
  • by TheCybernator ( 996224 ) on Sunday January 14, 2007 @10:08AM (#17602062) Homepage
    The power of VB doesn't lies in its methodology or programming techniques. But in ability to churn out an application faster to production. There is always a demand of non-critical business apps that are required for small production cycle. Here nothing can beat VB. Its so easy (i agree with its limitations) to learn. Throw in WIN32 API and it gets even powerful. I had been associated with one of the heaviest apps ever done in VB, running at 80+ locations in US (in late 90s) and is still alive though not supported my Microsoft (VB6).

    I truly respect Java and C++ and others. But for its contributions in business apps VB deserves its due respect.

    Sorry the post went little off-topic. Readers' and moderators' desecration anticipated.
  • by Anonymous Coward on Sunday January 14, 2007 @10:22AM (#17602126)
    The power of VB doesn't lies in its methodology or programming techniques. But in ability to churn out an application faster to production. There is always a demand of non-critical business apps that are required for small production cycle. Here nothing can beat VB.

    Maybe this was true in the very early 1990s. But not anymore. Python [python.org] is a far superior language. It's just as easy to learn as VB, you get a far faster development cycle, and your applications are actually portable.

  • by Lucas.Langa ( 922843 ) on Sunday January 14, 2007 @10:28AM (#17602148) Homepage

    As funny as your comment is, it made me wonder... There is a very loud pro-Lisp community that tells everyone who is not using Lisp that they should since it solves most of the problems they have in the first place. OK, fair enough. But I have that strange feeling that assuming the developers to be usually very smart and very lazy, we would see them all convert to Lisp if it really was the ultimate answer [1].

    And what makes me think that Lisp was and still is widely ignored? There are a couple of points here but the most important is: we don't really see a large, consistent standard library for Lisp. So we could easily turn the Greenspun's 10th Rule backwards to say: any sufficiently complicated Common Lisp program contains an ad hoc, informally specified, bug ridden, slow implementation of half of Java's standard library.

    So, where's the catch? Why isn't Lisp popular if it's so 1337?


    [1] But we know it's 42.

  • by Anonymous Coward on Sunday January 14, 2007 @10:29AM (#17602166)
    I think this is an interesting question. I assume that it is because most of them are either pragmatic programmer loyalists and they've needed a new language so that they could write books about it or most of them haven't programmed before and Ruby is kind of hot at the moment. I like ruby, it is kind of neat but I get this overwhelming feeling that very few members of the community have done any significant engineering and have close to no computer science either.


    The comparison to Lisp, to me, and I actually am a computer science grad, is really interesting. You see, perl has maybe the shittiest syntax of any regularly used language, either it or C++. You can take snips of it and they can mean radically different things syntactically depending on the program around them. You can do beautiful things in both and you can do terrible things, incredibly terrible things. (I'm not against Perl or C++, just that a large amount of code in those languages has rather ugly looking syntax)


    Lisp, doesn't have syntax. Aside from macros. You program in abstract syntax trees. Why you'd want to make that more perl-like or anything-like is foolish, it's perfect as it is. Maybe you want ASTs to be formatted differently but it's still ASTs. There is no syntax to fix, if you with to fix it produce a language and take the ASTs and make them LISP compliant. It's like taking a muscle car and then trying to make it a bit more prius like, it flies against everything that makes the muscle car a muscle car. I'm trying to make black just a little bit more white. It seems to me that you don't really understand Lisp if you're trying to replace it with Ruby or make it more perl like. Possibly just a side-effect of the pragmatic guys, they suggest learning a new language every year and most of their loyalists spend a couple weeks, read a book or two and call it "learned" when maybe they should spend half their coding time coding in it. There is nothing remotely lisp-like about Ruby, not even close; closures? That's it? come one.


    So Ruby is the output of a plan to take a syntax-less language and make it a bit more like a language with, IMO, one of the shittiest syntaxes around? How does any of this help me write programs that are more correct, more reliable and have more features and do it in less time? Sure, there is a tiny bit less typing because of the syntax..

  • by TheRaven64 ( 641858 ) on Sunday January 14, 2007 @11:03AM (#17602376) Journal

    I mean, take Lisp and its performance. Compare it to Ruby's. Matz said himself that Ruby started as a kind of Lisp reconsideration. And you call this progress?
    Right. Common Lisp is very fast; on an architecture that's not register-starved the Steel Bank compiler can produce code that is faster than C++ running the same algorithms, and Lisp is a lot more flexible. While I like the Lisp semantics, I find the syntax a little, uh, minimalist, and I prefer Smalltalk[1], which has a similar amount of flexibility. Smalltalk running in the Squeak VM is fast enough to run video CODECs written in Smalltalk on a relatively modern laptop, and is faster than Ruby.

    I still don't seem what advantage Ruby has over Lisp or Smalltalk; it is no more expressive, and current implementations generate slower code.


    [1] A List programmer will tell you Smalltalk is a great language, because you can implement a Lisp interpreter in a few lines of Smalltalk. A Smalltalk programmer will tell you Lisp is a great language, because you can implement a Smalltalk interpreter in a few lines of Lisp...

  • by Snarfangel ( 203258 ) on Sunday January 14, 2007 @11:09AM (#17602414) Homepage
    ...absolutely none. It's a horrible language. The only thing it has going for it is the reasonably useful IDE (although even that irritates me most of the time).

    I guess you don't want to try SNOOZ, which is my COBOL-ification of VB.
  • by Colin Smith ( 2679 ) on Sunday January 14, 2007 @11:11AM (#17602420)

    and we're stuck maintaining or converting an app in a technology we wouldn't have chosen that looks like it was designed by a pack of drunken monkeys.
    And yet it performs a useful function for the business... If you don't like it, you could always move to a different job or business.

    Or.

    Perhaps you might want to extend your remit to advocating the technologies you would choose, to the business management. Perhaps you might even want to create a development environment for personnel to produce adhoc applications in the technologies you prefer. Or shock, horror, you could even provide that service within the IT department and actively go looking for opportunities to improve productivity.

     
  • by TheRaven64 ( 641858 ) on Sunday January 14, 2007 @11:30AM (#17602556) Journal

    It is so powerful because it directly allows the programmer to access and modify what amounts to the AST of his or her program.
    If you want a really good demonstration of this, take a look at Erlang. Erlang has a feature as powerful as Lisp macros called Parse Transforms. The compiler spits out the parse tree as a set of nested tuples and passes this to a user-suppled function. This then returns a transformed version of the parse tree. This has exactly the same power and expressiveness as Lisp Macros. The difference is that every Lisp programmer uses macros, because they are as easy to use as function, while almost no Erlang programmers use Parse Transforms.
  • by bhima ( 46039 ) <Bhima,Pandava&gmail,com> on Sunday January 14, 2007 @11:30AM (#17602560) Journal
    I'll hazard a few guesses:

    1: It is popular among people who are solving problems LISP is well suited for.
    2: There are other languages that are more suited for what most developers do.
    3: There are other languages that are more successfully marketed.

    I've earned more money in less time using COBOL than any other language but you don't hear me telling kids to pick it up.
    Nor do you see me selling COBOL for new projects.

    I don't think all of this "what language is 'leet" talk is productive or illuminating. You have a problem, so you use the best tool you can find and learn how to use to solve that problem. If anything I find LISP excels at allowing me to solve certain problems in very interesting ways. Ways that perhaps using the currently popular language wouldn't have allowed.
  • by tacocat ( 527354 ) <{tallison1} {at} {twmi.rr.com}> on Sunday January 14, 2007 @11:35AM (#17602614)

    True Dat. Between Perl, Python and Ruby. Ruby is the slowest by far. And be careful how you write your code. Sometimes attaching method.method.method is about the worse way you can go, even though they claim it is the Ruby Way. Bah! I'll take perl. At least it has docs.

  • by The_Wilschon ( 782534 ) on Sunday January 14, 2007 @12:16PM (#17602958) Homepage
    Interpreted is still slower than Compiled. Always will be. However, the reason that that problem has *somewhat* gone away is that machines are fast enough now that for *most* situations (UIs being one example), that is not a problem. However, for some problem domains (eg scientific programming), speed will never cease to be an issue. The faster the machines we have, the more we will throw at them. Lattice calculations work better with a smaller lattice spacing, and a faster machine allows a smaller spacing.

    However, most of the interpreted languages which have appeared to resolve their speed issues have done so by some form of on the fly compilation. So yes, ruby could move up to even with the lisps in that way.
  • by CoughDropAddict ( 40792 ) on Sunday January 14, 2007 @12:59PM (#17603294) Homepage
    Actually there is a good reason to look at Perl given Ruby. Regular Expressions. Ruby has a object and method for doing regular expressions but compared to Perl it's very combersome and is even lacking some of the properties that Perl's regex has.

    Cumbersome? Which is this, Perl or Ruby?

    "Hello, World!" =~ /Hello, (\w+)!/;
    print $1;
    Trick question -- it's both. What exactly about Ruby's way is cumbersome?
  • Hrm. Well, I seem to remember an article at Joel Spolsky's Site [joelonsoftware.com] about why he thought VB was a decent tool in ways. Remember, it has no memory management; I've done memory management, and I never want to do it again unless rains of fish will occur. It's not that it's hard, it's just that it's silly for me to do. How can you possibly feel differently?

    Additionally, if VBA didn't exist you'd have to write C++ to do simple macro'ing in Office products. It's profitable, but it bites the big one as far as interesting programming jobs are concerned. Trust me on that one.
  • by wootest ( 694923 ) on Sunday January 14, 2007 @02:07PM (#17603996)
    I agree with part of your comment. Ruby is my Perl 6 until Perl 6 comes along. I'm okay with Perl's eclectic syntax and I know some other people aren't, but for now Ruby is one of the best Perl 5 alternatives.

    The thing with Ruby this far is that it's still in its first major version by version number. There's not one bit of the Ruby design that I'd like to change dramatically, but there's a bunch of problems that arise from its current implementation. The one-pass compiling (which while surely easier to implement probably has performance and optimization implications down the road), non-concurrent thread policy and strings that default to the mythical "unspecified" encoding are some; things that all look to be set for correction in the upcoming Ruby 2.

    Then there's the lack of thorough documentation, and the air emitted by rubygems as something tacked on instead of mostly integrated (like CPAN). I am hopeful that these things will resolve themselves in due time, but as you say, Ruby is already a language to be reckoned with.
  • by ClosedSource ( 238333 ) on Sunday January 14, 2007 @03:43PM (#17604934)
    "This is exactly the kind of reply I would expect from a VB developer or "non developer". By "quickly create applications to fulfil their requirements" you probably mean "create a horrible unmaintenable mess which not even the original author will touch, and which has is almost certainly going to be rewritten by a developer at some point in future".

    There are a number of interesting, unproven, and contradictory assumptions built-in to your statement:
    1) All VB code is a mess
    2) VB applications are successful enough to justify being maintained
    3) Despite the success of the application implemented in VB, it makes sense to rewrite it in another language
    4) The orginal developer isn't willing revise it, but somehow some other developer is willing to rewrite it.

    "Enabling non developers make production code is *NOT* a good thing, I think most people with some experience in the industry will agree with this."

    If by "non developers" you mean VB programmers, and given that a fairly large percentage of people in the industry with some experience are VB programmers than your statement is incorrect.
  • You never heard of Python, Ruby, or Smalltalk? That explains your problem.

    For years even though I swore at VB I didn't really hate it. Then I caught it in an arithmetic mistake. I, a human, caught a computer at an arithmetic mistake. Understand, I'm not talking about the program, I traced the error down to one specific statement in a program, placed print statements before and after it. VB made an arithmetic mistake. Then I started to wonder about all the larger numbers that I hadn't checked over the years.

    That was the last program that I ever wrote that used VB for arithmetic. The next one I used an external Eiffel program to do the arithmetic. The one after that I had it all happen in an Excel spreadsheet. Since them I've moved to Python and Ruby...and totally off of MS systems.

    I don't believe that anyone who is a decent programmer likes VB, though many use it due to coercions of various forms. (You mention interesting jobs.) Most people probably haven't noticed that it sometimes lies. (And maybe they've stopped doing that. This happened in MSAccess2000, around 2000.)

    No dialect of BASIC has ever been a decent programming language, throughout it's history. (Well, there are lots of versions that I haven't tried, so that's excessive. Some people said that Pick Basic was quite good.) It strongly encourages bad programming habits and discourages several good ones. There are dialects of BASIC in which it is actually impossible to write a decent program. Or a stable one (different group). This isn't to assert that it can't be very convenient. Especially in environments that are designed to encourage it's use.

  • by TheRaven64 ( 641858 ) on Sunday January 14, 2007 @07:13PM (#17607038) Journal
    Objective-C has categories, which allow adding methods to a class at runtime. It is a pure superset of C, so it can be mixed with C (and, now C++) in the same source file. Oh, and the whole 'on rails' concept is a copy of a web framework that began life with Objective-C; there's even a Free re-implementation of it, take a look at GNUstepWeb for more information.

"Spock, did you see the looks on their faces?" "Yes, Captain, a sort of vacant contentment."

Working...