3 ms·
Why? It's a very runtime-oriented environment. In fact, the syntactic meaning of fairly common examples of Ruby code can't be determined until runtime. This
by stcredzero 17y ago
Why? It's a very runtime-oriented environment. In fact, the syntactic meaning of fairly common examples of Ruby code can't be determined until runtime.
This is one thing that the Rubyists get right that the Smalltalk community as a whole never manged to get around to. (Though, to be fair, the Smalltalk community is largely responsible for the origin of the XUnit suites and the idea of fanatic unit testing.)
If there was a Ruby-like language that ran an order of magnitude faster, and had optional type annotations, would it become popular?
I wish someone would make optional typing for Lua and write something like Rails for it.
- silentbicycle 17y ago> I wish someone would make optional typing for Lua... I've wondered about this, as well. Adding it would probably greatly increase the size of the language/compiler, though (which goes against its major strength of being easily embeddable), and its not clear to me how it would fit with the underlying VM's design[1]. Just having a runtime-checked type system is quite a bit simpler, until programs get to a certain size. I like inferred statically typed languages, but I think it may work better to leave Lua as-is, and instead focus on making an equally clean-but-pragmatic ML-styled language. H-M type inference, Haskell-style typeclasses, and pattern matching in the core language, but with the same tastefully minimalistic design that Lua has. Lua is (IMHO) an excellent scripting language, but it's still stateful/imperative by default. While OCaml and SML aren't purely functional, their design encourages going that way more than Lua's does, and it changes the semantics of the language considerably. (FWIW, I'm studying Prolog, unification, type systems, etc., and would love to work on such after I get a few more immediate projects finished...) [1]: http://luaforge.net/docman/view.php/83/98/ANoFrillsIntroToLua51VMInstructions.pdf http://luaforge.net/docman/view.php/83/98/ANoFrillsIntroToLu...
- stcredzero 17y agoI'm thinking of doing something with adding optional typing to Smalltalk by just adding it to the compiler. Maybe add H-M type inference as well. One could do the same for Lua. Actually, I'm thinking of implementing a Smalltalk VM on top of LuaJIT and Javascript by JIT to the host language's source code.