On Sat, 28 Sep 2002, William Djaja Tjokroaminata wrote: > ruby -type_check_level 0 => invokes the current Ruby interpreter/parser > ruby -type_check_level max => invokes R (statically typed) > ruby -type_check_level k => somewhere in between (a mix) > > Probably this is too much/too complicated? That would imply one language, would it not: one syntax. It may be doable, but I doubt it. I also doubt the utility of such a language, given the suggested almost automagic interfacing between ruby and R. > sacrificing human readability. Is it possible to have R, with syntax > similar to Ruby, but with capability (and execution) like C? I believe that a statically typed ruby-like language (lets' drop the R, since it's used already) could be implemented, with an execution speed comparable to C, yes. The automagic ruby-interface is where the _real_ challenge would lie, I think. > include <stdout.h> # No need fot this. Ruby-like syntax, remember? So things in stdio would # already be in the core. > def main (): Fixnum > print "hello, world!\n" > 0 > end # Not very ruby-like? How about: ;) def main puts "Hello, world!" end Seriously, I think we would lose things like open classes, and have a method definition syntax like: METHOD := 'def' TYPE? NAME '(' PARAMETER_DEF* ')' METHOD_BODY 'end' PARAMETER_DEF := TYPE NAME ('=' LITERAL)? Yeah, it's just a toy example, but there you go. Uglier than ruby, for sure. That is also one of my main quibbles: is ruby-like syntax really suitable for a statically typed language? Ruby resonates in a ertain, dynamic way, which may be far from an ideal statically typed language. Hmm. A statically typed language with a ruby-like philosophy might be a better idea. The major difference would be that whre ruby is reclessly dynamic, this language would be reclessly static. ;) Yours, -- Nikodemus