Slashdot Mirror


Ioke Tries To Combine the Best of Lisp and Ruby

synodinos writes "Ola Bini, a core JRuby developer and author of the book Practical JRuby on Rails Projects, has been developing a new language for the JVM called Ioke. This strongly typed, extremely dynamic, prototype-based, object-oriented language aims to give developers the same kind of power they get with Lisp and Ruby, combined with a nice, small, regular syntax."

44 of 255 comments (clear)

  1. Try Io by QuantumG · · Score: 4, Informative

    http://www.iolanguage.com/

            Io is a small, prototype-based programming language. The ideas in Io are mostly inspired by Smalltalk (all values are objects, all messages are dynamic), Self (prototype-based), NewtonScript (differential inheritance), Act1 (actors and futures for concurrency), LISP (code is a runtime inspectable/modifiable tree) and Lua (small, embeddable).

    --
    How we know is more important than what we know.
    1. Re:Try Io by Smauler · · Score: 4, Insightful

      New languages are announced every week or so in different places... it doesn't change the fact that the language that most big projects rely on now is one of the old guard. C is, despite it's incarnations (or deformations, depending on who you believe) still king, and it was designed in 1972.

    2. Re:Try Io by Kingrames · · Score: 4, Funny

      Two. hand in your geek badge.

      --
      If you can read this, I forgot to post anonymously.
    3. Re:Try Io by MrNaz · · Score: 5, Insightful

      The idea of these new languages (Python, Java, Ruby, and presumably ioke) is to abstract very common functions to increase the speed of development.

      Every layer of abstraction increases the "power" of the language from a development point of view, allowing developers to do far more than they could with a single line of code, trading off flexibility, and performance.

      The idea of a new language is to deliver as much "quick access" functionality as possible (saving the developer having to implement their own low level functionality such as string classes, array handling and perhaps memory management) while compromising as little as possible on flexibility and performance.

      If ioke delivers a best-yet mix of these trade offs, then it stands a chance to become the Next Big Thing. Personally, I think that Python is the state of the art when it comes to highly functional development languages that still deliver good performance and flexibility. It's not quite fast enough to write an operating system in (although there was an effort called Unununium which tried but never took off), however it is vastly superior, both in overall design and performance, to other languages that provide a similar level of abstraction such as PHP.

      --
      I hate printers.
    4. Re:Try Io by julesh · · Score: 4, Insightful

      [Python]'s not quite fast enough to write an operating system in (although there was an effort called Unununium which tried but never took off)

      Unununium's kernel was, I believe, written in C. The user interface, userspace applications and drivers would have all been written in Python.

      Unununium didn't take off because its developers had no clue about OS design. They apparently spent most of their time boasting about how their operating system didn't have a kernel (it did; its kernel was a slightly modified Python interpreter[1]) and how it was such an innovative design (when all it did was replicate some of the achievements of traditional language-based systems that were popular in the academic research community in the 70s and early 80s, cf. Smalltalk-80, which although now generally considered just as a language was originally considered by its developers and users as an operating system, or the earlier CMU Hydra system which was built around similar principles), and not enough time actually writing the damned thing.

      [1]: The issue seems to be one of understanding what a kernel is. The unununium developers seemed to believe the defining factor of a kernel is that it provides inter-process protection by allocating different memory spaces to the different processes. Under this view, many modern OSs don't have kernels, including Singularity and JX. Also, some older ones, including 16-bit Windows and Amiga.

    5. Re:Try Io by Anonymous Coward · · Score: 2, Informative

      Good lord, you haven't done a damn thing at the low level, have you? First, the instruction set argument is complete nonsense -- there's no such thing as a "BYTE code" instruction set, it's a format for compiled code, and the code becomes x86 before it runs on your CPU.
      Second, what you're running on should never relate to language choices unless you're running on an embedded platform. Java code is compiled to the CPU just like everything else, it's just done at runtime.
      You miss the point: people use C because it's a battle-hardened language, not because of some machine restriction you seem to think exists.

  2. "Best"? by FlyByPC · · Score: 2, Funny

    (There's (a best) (part (of LISP)))?!?

    --
    Paleotechnologist and connoisseur of pretty shiny things.
    1. Re:"Best"? by mechsoph · · Score: 2, Funny

      Make that: (? (is there (part a best (of lisp))))

    2. Re:"Best"? by QuoteMstr · · Score: 4, Interesting

      The parentheses just disappear after you've coded Lisp for a while. Also, try paredit.el for Emacs. With that turned on, you don't edit text, but sexps. It's wonderful, once you get used to it.

      As for Lisp itself, well, 20 years ago did for the first time many of the things that mainstream languages today are just beginning to obtain, like closures, arbitrary lexical scoping, highly dynamic data structures, and (in Scheme's case) call/cc. One thing gcc just implemented is per-function compiler optimization settings. Common Lisp has had a facility for that since the beginning of time.

      One thing that still isn't matched by other languages, however, is Lisp's macro system. It's far more powerful than C macros. You can define new control structures, implement sub-languages, and construct any higher-language construct you want. And these features you build all look just like native language constructs.

      And don't even get me started o CLOS, which is one of the very few object-oriented systems to provide a clean multimethod dispatch solution.

    3. Re:"Best"? by cheater512 · · Score: 2

      Have you had your eyes checked recently?
      If you cannot see *that* many brackets then something is horribly wrong. ;)

    4. Re:"Best"? by hachete · · Score: 3, Interesting

      Dylan had a very powerful macro system.

      http://www.opendylan.org/

      with all the advantages of a late-bound language.

      --
      Patriotism is a virtue of the vicious
    5. Re:"Best"? by Haeleth · · Score: 2, Funny

      Oh, please. There's a macro for this:

      (best-part-exists? 'lisp)
      ==> t

    6. Re:"Best"? by ukbazza · · Score: 2, Funny

      Was that before he went electric ?

    7. Re:"Best"? by pz · · Score: 2, Insightful

      As it is, Lisp faces real problems in garbage collection and system resource management, or at least it has traditionally faced such problems.

      You are confusing reputation with reality.

      LISP was the first language that required garbage collection, and that radical idea was fought tooth-and-nail by the rest of academia and industry. But the garbage collection technology developed was fast and reliable (I knew many of the people intimately involved in making the GC for Scheme at MIT). There was certainly an overhead that was paid for running a GC, but the smart folks at various academic and research institutions figured out how to minimize that overhead, and, moreover, spread it out pretty evenly so that your mission-critical system didn't suddenly go autistic for 30 seconds while it went through a sweep.

      Fast forward to today. You do realize that Perl has a built-in garbage collection system, right? And that Perl runs thousands upon thousands of web sites, some of which are quite large and commercially successful? That there are thousands of people using it every day?

      So, my conclusion: having or not having a garbage collector is not a relevant issue. Lisp just does not, "face real problems in garbage collection and system resource management," nor did it "traditionally [face] such problems." You are parroting an old and stale bit of propaganda.

      If these issues were so crippling, as you imply, then how would it be possible to write an entire operating system in LISP? Perhaps you never saw any of the machines like that, but they were legion. There were at least three reasonably successful companies started on that very idea.

      But your final paragraph above ("But I've also cleaned up ...") complains about something that has absolutely nothing to do with LISP, but with poor programming. I've taught LISP at MIT, and find that people who have learned LISP from the classic text Structure and Interpretation of Computer Programs (notice the title does not say anything about LISP or Scheme) are far better programmers than those who have not. The people who have not been taught LISP make more of the egregious errors you suggest, because the standard way of learning LISP, in the classroom with SICP, beats the idea of proper use of abstraction into the students.

      In other words, and politely, most of your post is bunk.

      --

      Put my fist through my alarm clock with its ding-dong death inside my ear. - The Blackjacks.
    8. Re:"Best"? by Raffaello · · Score: 3, Informative

      underscores? in lisp? are you mad!!?

      (best-part-exists-p lisp)

      i.e., hyphens as separators, p for predicate rather than the schemish question mark of you parent, and no need to quote lisp which is clearly being treated as a variable pointing to a language entity here, not a raw symbol in need of quotation.

    9. Re:"Best"? by DragonWriter · · Score: 3, Insightful

      If Lisp were that good, it would have done better in the marketplace.

      Lisp did fairly well in the areas where the problems it solved particularly well were common; C and friends did well where the things it dealt with well were the main challenges. when C was conquering the world, the latter were more common than the former. Increasingly, the problems Lisp deals with well have become relevant to more software, but C-based languages are pretty entrenched (both in systems and in programmer's minds), so instead of Lisp seeing a resurgence, you see C-like languages with more and more Lisp-like features bolted on. (The same is true with "Smalltalk" in place of "Lisp", too.)

  3. Outlook negative by incripshin · · Score: 5, Insightful

    Ola Bini has no beard. The only proof you need that this language will fail?

    1. Re:Outlook negative by Haeleth · · Score: 4, Funny

      No, no, you've got it backwards. Designing a successful language gives you a beard.

      Poor Grace Hopper...

  4. Prototype-based? I'll pass. by QuoteMstr · · Score: 2, Insightful

    I haven't used Self, but going by my experience with Javascript, prototype-based languages suck compared to conventional class/metaclass based ones. The problem is that parents of types must be *instances* of their parent types, and there isn't always a suitable kind of instance to use as a prototype. Either you end up coding around the prototype system and emulating conventional constructors, or you end up specifying special uninitialized states for base classes.

    Prototype languages make it easy to use the GoF prototype design pattern, true, but I find myself thinking "hrm, I need a new type" far more often than "Hrm, I need a prototype system for object initialization."

    Also, Python and CLOS style metaclasses give you all the flexibility of a prototype system.

    I'm all ears for any advantages the latter might have.

    1. Re:Prototype-based? I'll pass. by Animats · · Score: 4, Interesting

      I haven't used Self, but going by my experience with Javascript, prototype-based languages suck compared to conventional class/metaclass based ones.

      Generally true. Javascript was never intended for writing large programs. The object system is basically a hack on top of dictionaries. That's easy to implement, but doesn't scale well.

      This is one of the classic things one can do wrong in language design, and which tend to have to be fixed in later versions, painfully. Some other classic boners are leaving out a "bool" type (C and Python), not providing generics in a statically typed object-oriented language (C++ and Java), and not designing in separate compilation (ISO Pascal).

      Ioke is cute, but there's just no really good reason for such a strange syntax, and it's going to turn too many people off. Using whitespace as an operator (really!) is probably a bad idea. The ability to change the operator precedence dynamically may be "fun", but does not lead to readable or maintainable code. Experience with "read macros" in LISP indicates that rewriting code during input isn't good for readability either. On top of all this, Ioke allows regular expressions in code, like Perl. (It's not clear from the description if you can use regular expressions in the read macros to rewrite the regular expressions in the code. I think you can.) So Ioke brings together the least readable features from four different languages.

      People who come up with "l33t" ideas like this need to be put on maintenance programming of code written by others for six months or so.

  5. Lisp Syntax by mechsoph · · Score: 4, Insightful

    People think that s-expressions are a poor syntax. These people are wrong.

    Seriously, if you give yourself the change to wrap your head around it, s-expressions are both elegant and powerful. Representing your code as a data structure is what makes lisp lisp. Take that away, and you might as well just use ML.

    1. Re:Lisp Syntax by grumbel · · Score: 4, Insightful

      Seriously, if you give yourself the change to wrap your head around it, s-expressions are both elegant and powerful.

      Elegant and powerful? Sure. But Readable? No way.

      I like S-Expressions as XML replacement a lot, since for representing simple structured data its quite nice. But it just doesn't lead to very readable code when it comes to programming, even after some years toying around with Scheme, I still find "a = 5 + b" a hell of a lot more readable then "(set! a (+ 5 b))". The first paints a visual picture with clear symbols, the other is just token soup, it might be easy to parse for a computer, but very definitvly not for a human. Array access and a lot of other basic stuff is just a total mess in s-expressions.

  6. Oh boy! by jjohnson · · Score: 4, Insightful

    Another pocket language with idiosyncratic design choices that seem just right to the understimulated nerd looking for fame.

    --
    Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
    1. Re:Oh boy! by Maian · · Score: 4, Insightful

      He's announcing it way too early. He has practically nothing to show. There's only one tiny code example that I can see to gauge its merits.

  7. Re:Yet another wannabe Lisp minus macros by Maian · · Score: 2, Informative

    *sigh*

    It would help if you actually read the rest of the article:

    Just like Lisp, Ioke provides syntactic abstractions. They take two forms, the first one is macros, which is basically like method calls with lazy arguments that can be evaluated in special ways. The other form is syntax, which works a lot like Common Lisp defmacro. These together provide the possibility of creating new control structures and define new abstractions. The language is powerful enough to allow you to create your own method types, for example. If you don't like keyword arguments, you can define a new method type that doesn't have them. The DefaultMethod currently in Ioke could be implemented purely in Ioke, using macros.

  8. Clojure by slasho81 · · Score: 4, Informative

    If you're looking for a modernized lisp on the JVM, check out Clojure: http://clojure.org/
    All the goodies of lisp, the JVM, and functional programming without all the bad outdated stuff. It's a very cool language.

    1. Re:Clojure by shutdown+-p+now · · Score: 2, Insightful

      In my opinion, those are the three projects that one has to look into for cool (if you're a PL geek) stuff that is nonetheless bordering on mainstream: Clojure, Scala, and F#. Last two in particular, as Scala seems to be the "future of Java" to many advanced Java programmers who got tired of language limitations, and F# is being made a first-class supported language for the next .NET and Visual Studio release.

      Meanwhile, yet another my-own-programming-language-of-the-day is getting old. There are announcements of those pretty much every week on LtU. It may be interesting if it really explores some new dark corner in language design (particularly experiments with more powerful typing systems). But "combining the best of X is Y" is not it, sorry.

    2. Re:Clojure by slasho81 · · Score: 3, Interesting

      There is a lot of buzz around Scala and F#, and considering the limitations they lift from the more conventional mainstream languages it's understandable. But I think Clojure transcends both these languages and many other new on-top-of-another-platform languages because it doesn't just take the latest trendy language features and mix them with new syntactic sugar. It has a very well thought design that feels very right, elegant, and powerful.

      I can't recommend enough the screencasts by Rich Hickey, the language designer and main implementer.

      The 5th screencast, Clojure Concurrency, is most recommended by me for programming language aficionados. It's a long overview of the language and its philosophy regarding concurrency programming. After I saw that one, I was very excited about Clojure in a way that none of the latest languages made me feel.

    3. Re:Clojure by slasho81 · · Score: 2, Informative

      Slides and code for the 5th screencast about Clojure linked in the parent message.

  9. Lost in a sea of by Tablizer · · Score: 3, Funny

    Oh great, you combine the white-space-tab problem with the Lost in a Sea of Parentheses problem to get lost in a sea of white space ;-P

  10. Re:Awesome another langauge by ABasketOfPups · · Score: 4, Insightful

    Not one single soul in the world who was ever going to make a language, is now not going to, because of that rant.

  11. So... by julesh · · Score: 4, Insightful

    the same kind of power they get with Lisp and Ruby, combined with a nice, small, regular syntax

    So, it's Lisp then?

    Seriously... in terms of small regular syntaxes you don't get smaller and more regular than Lisp:

    s_expression = atomic_symbol \
                                / "(" s_expression "."s_expression ")" \
                                / list

    list = "(" s_expression ")"

    atomic_symbol = letter atom_part

    atom_part = empty / letter atom_part / number atom_part

    letter = "a" / "b" / " ..." / "z"

    number = "1" / "2" / " ..." / "9"

    empty = " "

    (source).

    Next smallest and most regular syntax for a useful language is probably smalltalk, but that's too long to post here. It's worth noting that smalltalk (particularly its first-class statement blocks) was a heavy influence on ruby. Smalltalk also gets close to hitting the 'nice' requirement, which IMO Lisp is a long way from.

    1. Re:So... by Haeleth · · Score: 3, Insightful

      Unfortunately that nice small regular syntax is only for the Lisp core. The actual language that you need to program in has all kinds of other syntactic features, starting with 'symbols and `(macro ,@quoting) and going rapidly downhill from there.

  12. Joke? by shoban · · Score: 5, Funny

    My eye sight must be getting bad... I misread this as:

    Joke Tries to Combine the Best of Lisp and Ruby

  13. Re:Try harder on the naming front... by fractalVisionz · · Score: 3, Funny

    Right, it's ioke.

    You mean, "Right, it's a joke." In some browsers, the bottom of the j is cut off. I invented a new language too, named asdlkj. It is whitespace combined with brainf*ck that sits atop the microsoft JVM that compiles down to executable php.

    Here is some sample code (tabs in [tab]):
    + + + + +[tab]<[. -]-.[tab] [tab]>-- [tab]<.+.

    I'm still trying to understand what it's supposed to do.

  14. Logic compression by TheLink · · Score: 2, Interesting

    I sometimes look at programming as a form of Compression. In this case it's decision/rule/logic compression.

    You can express any program with an infinite list of "IF THEN"s, but that's not very useful (and way too much typing).

    So that's where programming languages come in. Not all compression algorithms are great for all sorts of data and situations, similarly not all programming languages are good at all things. Of course there are some compression algorithms which are just plain crap :).

    A language that's powerful for a certain field will have good defaults so that a programmer does not have to do as much work to compress the rules. Typical faxes will compress very well using the standard fax compression method.

    While a lot of CS academics like languages that are powerful for the code you have to write (which is a good reason), do not be surprised when programmers in the real world pick languages that are powerful for the code they don't have to write (aka modules/libraries).

    You can have a newfangled language which has better compression that other programming languages so that you only need 1000 lines to do X, but it still is not that attractive if you still have to write all 1000 lines yourself, in contrast to using a language which requires 2000 lines to do X, but you only have to write 500 of those lines yourself. Others have already written the other 1500 lines AND best of all have documented and are maintaining them :).

    Marketing and positioning can be quite important in order to somehow convince enough people who like writing those 1500 lines to take up your new language.

    You can't expect lazy crap programmers like me to write all that code :). We'd rather do stuff like:

    use LWP; ...

    Or:

    import pyrad.packet
    from pyrad.client import Client

    Another problem with some languages favoured by CS academicians is they require very very smart people, and there are far fewer very very smart people than smart people (and far fewer smart people than stupid people).

    At a certain point conciseness (compression level) isn't as significant compared to the other overheads.

    So the ultrageniuses might not be much faster than the "merely smart" in writing the modules that the stupid people are likely to want to use, even if they use your superconcise language.

    And if there are 10x more "merely smart" than ultrageniuses, no wonder the stupid people pick the less powerful language - there might be 3-5x more libraries that they'd want to use.

    The ultrageniuses would be doing ultragenius stuff, so the modules they write might not be so useful for stupid people like me.

    And that's why some crappy languages are so popular (but I could be wrong since I'm stupid).

    --
    1. Re:Logic compression by ClassMyAss · · Score: 2, Funny

      Javadoc is my favorite thing about Java and the one feature/practice I wish was present in all the other languages I use.

      Right on - I think the importance of Javadoc being an official part of the language as opposed to some add on is often underestimated when people wonder why Java caught on so well, and the fact that most IDEs integrate Javadocs so seamlessly is extremely helpful. I've still never seen another language that has such a practical and actually used documentation system.

      When your IDE is set to automatically add Javadoc stubs to every method you write, it's almost impossible not to properly document your public interfaces; you feel "dirty" until you fill those guys in, and since it only takes a few seconds to do so, people actually tend to do it. And exporting a full set of HTML documentation based on that is a click away. Compare that to most other languages, where half the time the only way to figure out what the hell is going on in a library is to read tutorials or actually dig into the source code.

  15. Re:Per-function optimization by Haeleth · · Score: 4, Insightful

    Yes, people often don't see the point of things they've never tried, or of features that are missing from their current favourite language.

  16. No surprise by Sycraft-fu · · Score: 4, Informative

    That's because C deals with how computers actually think. All this new stuff with languages is wonderful, and often has some uses in various cases, however none of it relates to how a computer actually works. C is a good "mid level" language. By that I mean it does a good job of structuring programs in terms of how they actually work on a processor, while still being fairly easy for a human to work with.

    A lot of people get caught up in their "flavour of the month" language and forget that none of this relates to how computers actually work. For example yes, pointers are confusing and you can get in to trouble with them. However, that is actually how a processor handles things. It has registers that are pointers to memory locations of things it needs (like a pointer to the instruction to execute). So while more restrictive, managed references might be nice, they've nothing at all to do with how the processor works. That means you have to implement additional code overhead to deal with that sort of thing, and that you are losing the ability to optimise in certain ways.

    Basically C is likely to remain strong until we just have more CPU power and memory than we know what to do with on all platforms (embedded included). Until then there is the need to generate optimised programs. To do that, you need to be able to write a program based on how the computer thinks, not on how you do.

    1. Re:No surprise by jhol13 · · Score: 3, Insightful

      C is likely to remain strong until we just have more CPU power than [...]

      We already do (have more than C can handle[1]): dual and quad core processors.

      There is as of now no really good parallel (or multi-threaded) language. Java and Erlang are perhaps the best, which essentially says where we stand right now.

      Please do not talk about Posix thread libraries, they do tell enough about the memory model. Java was the first language to define one, but it is not 100% clear. C++ is just about to define one for itself[2].

      Therefore for example D is not the next language.

      [1] Not that you said or even implied that.

      [2] http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/

  17. (eq high-level-language scripting language)=false by teazen · · Score: 2, Interesting

    There's more out there in high-level land than the current crop of scripting languages.

    It's funny you mention that Python isn't QUITE fast enough to write an operating system in. I'd say it's dead-slow to write an operating in. Some guys at OLPC thought it was a good idea to write a window-manager in Python. And that is already dead-slow. Python as of now is still an interpreted scripting language. And I wouldn't exactly set the bar as low as to take PHP as a classic example of a fast, well designed language. I'm sure even the most rabid PHP fanboi (if they even exist), will agree with me.

    There are a good number of high-level languages which are a good bit more flexible at a much higher performance rate than Python. Take some of the functional languages like Haskell or ML, Lisps like CL or Scheme, or Forth or Smalltalk. Not that shootouts say everything, but just compare a few benchmarks at http://shootout.alioth.debian.org/

    And why are they faster? Because they can be (byte-)compiled quite efficiently. Python however was never designed with compiling in mind. And as such, there still isn't a worthy full-fledged Python compiler for real-live use. And as I understand it, Python is very dynamic in a way that's gonna be quite hard to compile.

    Now Python is an elegant scripting language that is easy to pick up, has a nice and big standard library and has it's niche, but people that dare to write ' is vastly superior, both in overall design and performance, to other languages that provide a similar level of abstraction', either blatantly choose to ignore decennia of computer science, or still have a lot of cool stuff to learn.

  18. This already exists by Reverend528 · · Score: 5, Insightful

    We already have a programming language with a simple syntax and the strengths of Lisp and Ruby. It's called Lisp.

  19. Re:Try harder on the naming front... by bryxal · · Score: 2, Funny

    That's the whole base code of Windows 7

  20. Comment removed by account_deleted · · Score: 2, Funny

    Comment removed based on user account deletion