For example, you will be able to call a little nugget like this
- Code: Select all
Stored in a variable, you may not even know that you're running GolfScript.
It's as if you suddenly have access to a pretty big (~400 functions; http://naivedesign.com/ND1/ND1_Reference__Function_Summary.html) function library that works with all your GolfScript types (and adds types of its own).
As this substantially augments what you can do in GolfScript, this language dialect receives a new name: "GolfScript/MorphEngine".
(Please use this as language name when doing golfing submissions, to prevent utter confusion.)
For example, this
is valid GolfScript/MorphEngine, and will produce:
This functionality will first be available as a shared folder ("GolfScript") extension download for ND1.
Not all arcane minutiae of GolfScript will be supported. For example, you will not be able to reassign the space (" ") character. (Though you will be able to do the almost-as-crazy thing of re-assigning digits.)
Likely, the first release will be usable but incomplete in some respects.
The extension will be released in full source code, so you'll be able to play with it and improve it.
How will this be used?
On the edit line, prefix GolfScript code with "gs:"
The code will then appear as a custom data type (http://naivedesign.com/ND1/ND1_Reference__Custom_Types.html) on the stack.
Eval to run.
As you'd expect, inputs come from the stack, and outputs go to the stack.
You also have a few other commands available for this data type.
You can see how the script looks like, written in RPL:
And you can concatenate scripts using the "+" key.
How's this implemented?
MorphEngine morphs GolfScript into RPL+ (http://forums.naivedesign.com/viewforum.php?f=9) and blends in functions during the run of the script that provide the expected run-time environment.
How fast will this be?
The original (and, until now, one-and-only) implementation of GolfScript is on Ruby, an interpreted language. It doesn't have a reputation for being a speed demon. (Though this rarely matters.)
For now, expect GolfScript/MorphEngine to run at quite similar speeds to the Ruby implementation, on the same hardware.
If you're using MorphEngine calls in your GolfScript/MorphEngine code, these will run at very fast speeds. (Much faster than if implemented, if you could, in GolfScript). For example, the permutate function used above will happily produce ~20,000 permutations per second.
Some benchmark results will be posted soon.
If you're excited by this and want access *now*, ping me and I shall oblige.