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."
ioke? Loke? I couldn't tell from just looking at the article, I had to check the (thankfully lowercase) link.
Not that it's all that melodious either way...
Mmmm, egg ioke!
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.
(There's (a best) (part (of LISP)))?!?
Paleotechnologist and connoisseur of pretty shiny things.
Ola Bini has no beard. The only proof you need that this language will fail?
the same kind of power they get with Lisp and Ruby, combined with a nice, small, regular syntax
In other words, this is just a reinvented Ruby targeted to the JVM. Without macros, what's the point? Why not just stick with Common Lisp and get all the power of Lisp, not just some of it, and still have a "small, regular syntax"? You can even use ABCL if you want to target the JVM.
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.
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.
Scripting in the JVM, I remember when they called that Coldfusion.
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.
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.
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
Table-ized A.I.
Is there a (popular) dynamic language that --hasn't-- combined facets of both Lisp and Scheme in its design ? And (inevitably) gotten it 'wrong' according to the Lisp/Scheme diehards on /. ?
We want it all - purity, simplicity, power and blinding speed - but every 'new' language/platform will be held up to the light of these two standards. For mine, the language is only part of the equation - its the libraries that the community contributes which make it practical to use language X over language Y. I'll stick with Perl, Python and Java for now. YMMV, and probably will.
It seems to me that per-function optimization settings would be useful in very few real-world cases.
Um, Scheme is a Lisp.
for shitty developers to produce crappy software with. Seriously STOP WITH THE 'LETS INVENT OUR OWN LANGUAGE' crap. REALLY. You're not going to help anyone. The good programmers already have PLENTY of GOOD languages to choose from, and your new language isnt' going to do anything for the crappy programmers because THEY AREN'T ANY GOOD AT PROGRAMMING, the language isnt' the problem.
We don't need a new compiled language.
We don't need a new vm.
We need to figure out what the hell we're doing with what we got and learn how to develop software that doesn't suck for users. The language isn't the problem there, we are, the developers who are spending our time trying to solve the problem by programing things for ourselves rather than listening to what the users want and need and STANDARDIZING on things.
You want to make computing better? Lets come up with some standardized way of doing things and improve on those together.
How many sources of electrical power can you get in your home right this moment where you live? 1? MAYBE 2? And no your own personal wind generators or solar cells don't count because you are missing the point. The end user just gets power, they know what they can use it for, anything that plugs in to a power socket.
How many sources of water can you get in your home? 2, maybe 3 if you count trucking it in.
How many different ways are there to start a common car? 1? 2 if you count keyless/remote ignitition.
The point to this is that all of those things people can and do use without needing to think about it. Not because someone invented a new way to start a car, but because everyone makes it so starting a car is the same for everyone instead of some whacky new 'look how pretty my new GUI is compared to the one that worked perfectly fine yesterday, forget the fact that we have our own names for everything thats probably not like anyone elses, and our own file system layout'.
Adding another useless option isn't going to help anyway, its just going to waste time. Yes, research is important, but this crap isn't research, its just another developer wanting to do his own thing because he's somehow 'better' than everyone else. Your new language isn't going to help bad programmers suck any less and its not going to really make a big difference to any good programmers as language doesn't matter to them for the most part anyway, except for some tiny little niche you might fill. MIGHT. Its likely in this cause being that its built on the JVM, that people should probably just use java anyway.
The last thing we need on slashdot to go with the daily slashvertisment and 'ask slashdot because I'm clueless' articles is another language thrown into the above to articles when clueless developer asks slashdot which language he should use for his new project. 2 hints on this matter: If your asking, you shouldn't be doing the project. Second, slashdot isn't going to help, its just going to confuse you with the opinions of several hundred other assholes just like me who think we all know everything perfectly. /RANT
Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
There, I've said it.
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:
(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.
My eye sight must be getting bad... I misread this as:
Joke Tries to Combine the Best of Lisp and Ruby
My problem with expressing everything as a list structure is that it's A data structure, and that it seems my brain doesn't think like that.
Why not instead of lists, use maps + lists ? You can of course express a map with lists but maps/"names" are so natural to think with that I think it would be easier to express ideas with it. "Naming" is very natural, and I don't think names as lists of lists.
Having a unified data structure to handle code and data is nice for me, but the expressiveness of one data structure is too limited for me. I don't speak lists, I speak lists+namespaces.
I sometimes look at programming as a form of Compression. In this case it's decision/rule/logic compression.
:).
:).
:). We'd rather do stuff like:
...
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
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).
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.
((((((((((((((((Really?))))))))))))))))
Pictures or it didn't happen ;)
Looks interesting. I've been wanting a functional language with a read-execute loop which I can put on my PocketPC for a while, but not finding anything. I'll have to play around and see what I can do with Clojure.
"Since it's quite terse and provide powerful features for succinctness, it should be very maintainable."
Yeah, sure. We all know how maintainable APL and Forth are. Wikipedia identifies as a feature of write-only code "syntax which permits (or encourages) the writing of very dense code." I can't help thinking that "Those who do not learn from history are doomed to repeat it".
Quidnam Latine loqui modo coepi?
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.
Seriously, why is everything in/about/emulating Ruby right now? From what I understand, this implementation isn't necessarily that much like Ruby, but given the summary it seems people would like to think/hope so.
Don't get me wrong, I like Ruby but I would never seek to emulate it. The language libraries are inconsistent and poor in many cases and there are other serious design issues. It's a cute little language great for shell scripting and quick one-offs, but I still cannot take it seriously after trying to prototype out various projects in it and seeing many weaknesses.
If you're not using some existing implementation/framework in Ruby such as Rails, why use it at all? Smalltalk and Lisp have done the same things are more much better since the beginning of time. Both languages are far cleaner, with Smalltalk having the better syntax IMO and Lisp having the advantage in power. If you could combine Smalltalk's dev environment and VM with Lisp's power, then we would have something worthy of actually looking at.
Wewby!
Lisp Cycles
Still one of my all-time favourites.
crappy name for a language.
the Norse trickster god. Seems like a better name for a language.
Ever heard of templates?
As the island of our knowledge grows, so does the shore of our ignorance.
We already have a programming language with a simple syntax and the strengths of Lisp and Ruby. It's called Lisp.
Badass Resumes
Meh. Call me when someone writes an operating system in XSL.
The good programmers already have PLENTY of GOOD languages to choose from
Unfortunately, they also have plenty of bad languages to choose from, and they tend to choose the ones that suck the most.
Perl. C++. Java.
Good languages like Lisp and Smalltalk get no respect. Attempts to graft C/Pascal syntax on Lisp and Smalltalk get no respect.
I like to see new languages tried. Maybe one that doesn't actually suck will catch on.
Why are you all crying when a new language comes out? For my point of view designing a language is like art, and often a opportunity to explore new paradigms/designs choices/technologies. No one forces you to use this language, like no one forces you to listen to some particular song or some other artwork.
If it's built to run on a JVM the output can be decompiled by a Java decompiler (like JAD). How crazy does the output look, going from Ioke to Java bytecode to Java source code? Or vice versa - could one take .class files, decompile them into Ioke, and be able to work with them?
Did anyone else read that as Joke with a serif-compensating complex?
Tcl is already the closest thing to a rational, usable lisp without the parentheses. It's grammar is only slightly more complicated. Most lisp goodies that aren't there by default can be easily added if one desires.
I am becoming gerund, destroyer of verbs.
God you fucking unoriginal *nix fappers need to fucking die.
Python is very dynamic in a way that's gonna be quite hard to compile.
But not impossible.
Look at LLVM. It runs C. It can statically or dynamically compile bytecode, and the generated executable is comparable to one straight out of gcc -- sometimes faster, because of optimizations which can really only be done at runtime.
I don't know about Python, but I know that a fork of Ruby (Rubinius) has been looking at it. So I absolutely think a dynamic language like Python can be made to run much faster, maybe faster than C.
Oh, and the other languages you mention -- cool, but also quite weird. Given the choice, how many people would really rather write LISP syntax than Python syntax? I like a lot of the ideas of LISP, and I realize that these scripting languages are just catching up, but there's a reason it stands for Lots of Insidious Silly Parentheses.
Don't thank God, thank a doctor!
I think your idea of this "elementary paradigm of Lisp programming" is way too monolithic. I do agree that there's a loudmouth Lisp programming school that preaches some really awful practices, like "use (singly-linked) lists as your only data structure."
However, the worst Lisp code I see suffers from too little abstraction, not too much. The worst, stupidest case is using lists as records, and accessing the "fields" of a "record" through concrete list operations. ("Ok, I want to get the date of this transaction. Um, is that the third element of the list, or the fourth one?" Or even worse: "Aaaargh, this code I'm reading actually uses the cdadr procedure!") Then they use their "records" in an inner loop, and their O(n) algorithm ends up with an O(n^2) implementation. And when you try to fix it, well, you have to find all the places they create a new "record" to create a real record data structure, and find all the places they access the "fields" and do the same.
It's particularly annoying because the problem should never have happened: the program should have been written from the beginning to treat the records as an abstract data type, instantiated and accessed only through specialized procedures dealing with that type. Then you can change the implementation of the type without changing the code that uses the type. (And if the program could really benefit from using lists as a syntactic representation of the type, then the right way to do it is to provide functions that translate the between the private implementation of the type and the list-based external representation.)
But of course, if you write your code like that from the beginning, you might as well not use lists as the freaking implementation type to start with. The lesson is precisely what I started with: the loudmouth "use (singly-linked) lists as your only data structure" school of Lisp programming is evil.
Are you adequate?
> So I absolutely think a dynamic language like Python can be made to run much faster, maybe faster than C.
Absolutely, dynamic languages can be made much faster when using a different compilation strategy. And yes, there's some cool stuff going on in Ruby-land, there's the Gemstone thing and at least another promising implementation. Lisp went through the same phase in the 60's.
Some points here:
Not to say that it's impossible in Python, but Ruby isn't Python. All the mentioned languages are quite dynamic in some way or another. Some properties are just much harder to make efficient, because it's hard to give guaranties on behaviour, while it perhaps wouldn't be so hard if the specification would be slightly different.
'maybe faster than C' is just wild speculation on your part. Lots of high-level languages try to be faster than C. It ain't easy.
And I must say I just love your stab at Lisp. I'll bite, cause it gives me a chance to expound my deep love for it. Not so long ago I had a programming job in Common Lisp, and it's the most divine language to program in. Surely that's the thing God used to create the universe. Those parentheses, thanks to their uniformity, actually make it very easy editing code. Much easier than the C-syntax-derived languages in fact.
Bringing forward syntax as an argument is extremely silly in my view. You get used to syntax in a week or two, but you're stuck with the power and limitations of your language-features for as long as the boss hasn't asked you to rewrite your project in C++. But I'm sure you were just trolling a bit.
No, this isn't quite true. Lisp has plenty of syntax; they just call it "special forms." In fact, Lisp has arbitrarily much syntax, given mechanisms to define your own special forms (i.e., macros). Note that this isn't all good, because people can go crazy with macros and write code that's really hard to understand and, what's worse, really hard to debug.
What Lisp doesn't have a lot of is lexical syntax, nor operator precendence. If you look at a Lisp program, there may be unfamiliar syntax in there (i.e., macros whose syntax you don't know), but faced with that, you can at least tell how stuff is nested. (The one big exception to the lexical syntax part is reader macros. Reader macros are utterly evil, if you ask me, precisely because their use makes the above not hold anymore.)
After programming for several years in Lisp, I must say the syntax has me spoiled. Every time I try to understand a complex arithmetical or boolean expression in Java or SQL, I actually end up translating it to properly indented Lisp code in a scratch file, which makes it much, much easier to read. "Oh, so this is an addition of three summands, the first of which is the quotient of the subtraction of two things and the addition of four others."
Also, every time I try to get my head around something like Haskell, I just can never remember all the line-noise little infix operators that Haskell programmers insist on using. (In Lisp code you might have all sorts of crazy operators, too, but they'd just be functions or macros with long, descriptive names, like MONAD-BIND instead of >>= or whatever the hell line noise operator they use in Haskell for that.)
Are you adequate?
My first reaction to this is that it doesn't sound as "excessive" use of abstraction; rather, it sounded either as use of incorrect abstractions, or as a failure to model the execution of the algorithm. Two points here:
C and Java programmers are, as a general group, very bad at using abstractions too. Most often, they just use too few of them, the resulting code is too tightly bound together, and it's difficult to reuse or replace individual pieces of the resulting programs. Too many constructs that specify how to do something, instead of what result to achieve. (Compare for loops to map.)
Structuring a system in terms of nested abstractions is not at all bad for later performance tuning. In fact, what you described above sounds like the correct way to optimize such a system: find places where the interface between nested abstractions is a bottleneck, and rewrite in a more concrete manner to eliminate the cost. Basically, if you have poorly performing module A written in terms of B and C, replace A with a module A' that incorporates the necessary features of B and C, but without the abstraction layer bottleneck.
However, I object to calling that "violating the abstractions," because the interface of A' to its clients remains the same as before, and B and C may still be used in other places where they do help. All you're changing is the internal details of a module, so as not to use costly lower-level abstractions. Abstraction is about hiding internal details of the part of the system. If somebody insists that A should use B and C in the name of "abstraction," they're getting the idea completely backwards: the point of abstraction is precisely to make it possible to change A without having to change anything else. But the trick is only do this in places where performance is actually bad, so you reap the benefits of code reuse or implementation speed elsewhere in the system, where you do use B and C.
Um, there are plenty of Lisp systems out there that use compilation. What makes you think that Lisp systems cannot unroll loops?
Are you adequate?
Yeah, you know which languages are best. What a pity that 99% of working programmers are too stupid to see the light and move to a good language.
Or is it just possible that they're right and you don't see the whole picture?
Yeah, you know which languages are best.
I know which ones are *worst*. Which is the point I was making, not that Lisp or Smalltalk are the best, but that they (and most other modern languages) are better than C++ or Perl.
Or is it just possible that they're right and you don't see the whole picture?
About as likely as the possibility that Fortran was the best programming language in the '80s.
What makes a programming language popular involves a lot of things that have nothing to do with the quality of the language itself.
If bad design was all that relevant to success, Microsoft would have gone out of business 20 years ago.
Comment removed based on user account deletion
I think what you really want is a good Scheme implementation. MzScheme might do it for you, unless you want something more compilation-oriented (though MzScheme does have JIT these days, I hear).
Are you adequate?
Comment removed based on user account deletion
Some properties are just much harder to make efficient, because it's hard to give guaranties on behaviour, while it perhaps wouldn't be so hard if the specification would be slightly different.
While true, I think that sometimes the changes aren't too bad.
And you don't need guarantees to optimize -- just educated guesses. You always keep enough around so that if your guess is wrong, you can drop the optimization and start over.
eval is never going to be fast, in any language, and you can make a lot of assumptions by ignoring it. But being able to eval when you really want to, even if it's a performance hit, is a beautiful thing.
I know eval is generally bad practice outside of an interpreter shell. It's a good example, though, because the things we really care about (define_method, method_missing, etc) are all somewhat less dynamic (and less troublesome) than eval. And if eval works, you can probably add any of those that are missing.
'maybe faster than C' is just wild speculation on your part. Lots of high-level languages try to be faster than C. It ain't easy.
Enough of them get close that I start to think the main factor is the amount more research that goes into improving C speed, both by compiler experts and by actual hardware manufacturers.
And I must say I just love your stab at Lisp.
I can't take credit, that's an old one. Probably as old as Pathologically Eclectic Rubbage Lister, which is actually official.
Surely that's the thing God used to create the universe.
You'd think so...
Bringing forward syntax as an argument is extremely silly in my view.
Actually, I've discovered this is a central point, and sometimes more important than actual power.
Code is communication. With your peers, perhaps with you a month from now, even with the machine itself. It is a way to translate your intent into actual instructions so unambiguous a machine can follow them.
This has implications for all three of those parties. Speaking to others is important, because there's only so much you can do by yourself. Speaking to yourself a month from now is important, because there's only so much you can do while keeping the whole program in your head -- I would argue that readability is almost more important than how easily you can write code.
And it even matters for the machine -- because if you've managed to write a program which codifies only your intent, and nothing more -- which says much more about what you want done than how you want it done -- then that "how" can change, based on whatever is more efficient for the circumstance at hand.
It's true that a powerful-but-ugly language can do all of the above, provided everyone can read it well. What's important is how well it maps onto how you think, and how you actually communicate. Ruby, to me, is very readable and very natural -- I can express myself well in it, and when I read a chunk of Ruby, I actually understand what it does, even if I don't quite understand how.
The same cannot be said of most Lisp. I read a block of incredibly beautiful lisp, but it's only beautiful once I get it. And that takes awhile. It's like a Koan -- it certainly expands my mind, probably makes me a better programmer. But not for everyday use -- I don't want to try to use a Koan to order dinner. ("May I take your order?", "Give me the taste of a sugarless marshmallow.")
That, and... c'mon. Take a lesson from python and make at least some of those parens implicit.
Don't thank God, thank a doctor!
I'd take Lisp syntax over the stupidity of semantically significant indentation any day.
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak