RE: Strongtalk and Ruby
"David Griswold" <[email protected]>
| Newsgroups | gmane.comp.lang.smalltalk.strongtalk |
|---|---|
| Message-ID | <[email protected]> |
> -----Original Message----- > From: Richard > > Does anyone know how suited the ruby language is to run on the > strongtalk VM? Search the list for past messages about Ruby. This has been discussed before. Ruby should be an excellent target for the Strongtalk virtual machine. However, Ruby has a very messed-up grammar, which makes it hard to write a new parser for it. > I see that the ruby community has a couple of efforts > to develop virtual machines (jruby and yarv), but I guess so far these > have not lead to much of a speed increase, and it seems that they > don't have the techniques employed in the strong talk VM. Being a > rubyist myself, I often miss being able to specify types and have the > feeling that ruby would benefit significantly having optional static > typing. Hence a second argument for wanting to target the stongtalk > VM. Strongtalk's type system has nothing to do with the virtual machine. Porting Ruby to the Strongtalk VM would not give Ruby a type system. > [...] > > What is the situation with threads and strongtalk? Is there any chance > that strongtalk will have any more than green threads? Does it have > green threads (os runs one thread, vm jumps between green threads, > uses non-blocking io)? Strongtalk does not use green threads. It uses native threads. However only one thread is allowed to run at a time, since the VM is not multithreaded. However, use of native threads means that Strongtalk can easily do blocking I/O. Callouts can be designated as asynchronous, meaning that other Smalltalk threads can be allowed to proceed while that callout executes or blocks. > I hope you'll excuse that little example. As maybe you can tell I much > prefer that ruby syntax the smalltalk syntax, but what I'm asking is: > under the covers at the VM level is pretty much all the same? Will > inlining remove all or most of the block structures in my example? > Would my ruby code run 10 times faster on the strongtalk VM (there's a > network call in the middle of the example, so I guess I mean, use 10% > of the cpu resources, not run 10 times faster. As far as I know the > ruby interpreter doesn't do any inlining)? Current Ruby VMs are very, very slow compared to Strongtalk, so the speedup would probably be a lot more than a factor of 10. Strongtalk is more than 10 times as fast as Squeak, which is itself faster than Ruby, I believe. Yes, inlining should probably remove all the blocks in your example; generally, any block that is only passed downwards as a literal argument to sends that are themselves inlined, will be inlined. -Dave --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Strongtalk-general" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/strongtalk-general?hl=en -~----------~----~----~----~------~----~------~--~---