Atomo, the programmer's programmable programming language
atomo-lang.org
atomo-lang.org
I'd call it "fast enough," but it's no speed demon. It's pretty early on; I just started planning Atomo's design this June. There's almost certainly some low-hanging fruit when it comes to optimization, and it is something I've been keeping a close eye on for a while now. It's only been getting faster, and in my testing of GHC 7 I saw pretty substantial performance boosts for free. And that's the nice thing. It's built on a fantastic platform, which you can drop into very easily whenever you want with a nice DSL.
Glad you like it, though. I completely understand the caution when it comes to performance of such a high-level language.
I've also written a few wrappers for Haskell libraries over at http://darcsden.com/alex - see http, json, and command.
Basically, you define your methods in Haskell, and call them from Atomo; these methods can be defined as an expression (=:::), a value (=::), or some arbitrary VM action to be executed to yield a value (=:). (Admittedly those operators have gotten a bit silly.)
The definitions use QuasiQuotes for the method pattern, and can use them for expressions as well, though that's not encouraged (operator precedence and macros make it a tricky thing to do at compile time). They look a bit noisy - [$p|x foo: y|] but that'll be fixed come GHC 7, where that pesky $ is removed.
More specifically, what prompted the creation of Atomo? Is it only for fun/personal research? Is it a school project? Is there a business problem that Atomo is solving?
(I'm just curious, this is not a "do we need another programing language?" criticism. I always wanted to write my own programming language for fun :)
$ sudo apt-get install haskell-platform libghc6-terminfo-dev
$ cabal update
$ cabal install atomo
$ ~/.cabal/bin/atomo
> 1 + 1
2Workshop on Self-sustaining Systems (S3)
http://www.hpi.uni-potsdam.de/swa/s3/
The Workshop on Self-sustaining Systems (S3) is a forum for discussion of topics relating to computer systems and languages that are able to bootstrap, implement, modify, and maintain themselves. One property of these systems is that their implementation is based on small but powerful abstractions; examples include (amongst others) Squeak/Smalltalk, COLA, Klein/Self, PyPy/Python, Rubinius/Ruby, and Lisp. Such systems are the engines of their own replacement, giving researchers and developers great power to experiment with, and explore future directions from within, their own small language kernels.
http://jashkenas.github.com/coffee-script/documentation/docs...
Also, most Lisps (especially Scheme) have a relatively small core written in C for bootstrapping, and the rest of the language is written in itself.
It had a handful of assembler code to bootstrap it, and from there it built upon itself
0 fib = 1
1 fib = 1
(n: Integer) fib :=
(n - 2) fib + (n - 1) fib
Reading the first line as "For zero, 'fib' is 1" is surprisingly intuitive. Not sure if this translates to something like x = Object clone
though. Maybe some conventions shouldn't be touched? fib 0 = 1
in Haskell? I just felt that this order works well for pattern matching functions, but not as well in other contexts. No CS background here, by the way; maybe I'm just missing your point.When you said "for 0, fib is 1," you could just as easily say "for the current scope object, x is Object clone." This is exactly how it works. Method dispatch is 100% pattern-matching, and Atomo's scopes are 100% message dispatch, combined with delegation.
When you say "0 fib = 1", the method is inserted on Integer. When you send a message to an Integer, you're sending (pseudocode) `Single "fib" (Integer 0)`. The methods on Integer pattern-match on that, in this case with `PSingle "fib" (PMatch (Integer 0))`. If that pattern fails, it moves on to "1 fib = ...", and finally to the least-precise "(n: Integer) fib := ...".
Not sure if that answers your question, but I thought I'd expand on it a bit.
I'm not sure how I feel about it, to be honest. But I do love me some pattern matching...
Here is the Greeter example in Io:
Greeter := Object clone
Greeter new := method (n,
Greeter clone do (name ::= nil) setName(n)
)
Greeter sayHi := method (
(name .. ": Hi!") println
)
Greeter new("Alex") sayHi
Very close. However even though I've tried to make it look identical you can see the differences poking through. And reading through the Atomo docs there are (naturally) other divergences.I would say that Atomo is probably more closer to Ioke (http://Ioke.org) than Io. The philosophy behind Io is to keep it small & simple. Whereas Ioke is Io + extra syntax, literals, etc baked in.
Worth keeping an eye on Atomo... as is Io & Ioke. For reference here are the other examples in Io:
File with("out-file") open do (
write("hello, world!\n")
)
fib := method (n,
if (n == 0, return 1)
if (n == 1, return 1)
fib(n - 2) + fib(n - 1)
)
list(1, 2, 3) sum
Range 0 to(5) map(* 2)Without going into Prolog, now that you have some pattern matching, maybe you could have some notion of success/failure, like in Icon, this is very expressive. http://en.wikipedia.org/wiki/Icon_(programming_language)
Getting the source right now to see what's inside.