|
|
|
|
|
by newuser88273
4234 days ago
|
|
This goes even deeper. Let's just go on and assume that Urbit's spec-bearing T-shirt includes everything you need for IO. Now consider this promise from Mr Yarvin, found in the older Urbit thread someone linked to: "And actually, if you don't like Hoon [Urbit's strange, obfuscated high level programming language] you can build your own language on this platform. So long as it compiles to Nock [purportedly documented on that T-shirt]" So you hook up your new Nock back end to your favorite compiler, painstakingly hand-crafted to generate Nock code perfectly conforming to the T-shirt spec. You compile a few programs. You run them. Heat radiates from the CPU... and nothing else happens. You wait, patiently at first, then way beyond patience, yet nothing (except heat). Don't you feel cheated, just a little? |
|
There is certainly no free lunch in this system. If your CPU is radiating heat, it is spending a bunch of time in Nock formulas which could be better optimized. For instance, maybe you rolled your own decrement, so the interpreter can't match it with the jet it uses for stock Hoon decrement.
That's okay, because the jet matching mechanism is not in any way specialized to the code. All you have to do is (a) get your compiler for the new language to emit a proper jet hint for your things-you-want-to-be-fast, (b) write correctly matched C implementations, and (c) add them to a static array.
Or to put it more briefly: a well-designed Nock implementation is not in any way coupled to the Hoon or Arvo layers.
One of the not-quite-finished things about our interpreter right now (other than that it interprets the tree directly and so gets about 1.5 Nock mips, which is pathetic) is that jets have to be compiled into the kernel and aren't opened by dlopen. Ideally we'd even load something like a PNACL/LLVM object, and we'd get it the same way we get the Hoon source, ie, via Urbit itself.