Bytecode
blog.mecheye.net
blog.mecheye.net
This was originally meant to allow you to come up with all sorts of fantastic transaction types, such as coins which need M of N signatures in order to be released, or a Kickstarter clause that only releases the coins if a certain amount has been pledged.
But, after the scripts had caused enough security vulnerabilities they were severely restricted. Clients will now only accept transactions which include one of the standard scripts.
Furthermore, exactly what you consider to be a bytecode vs a machine language can be a bit of an open question. After all, Intel CPUs don't actually execute the x86 instruction set directly, the execute microcode which translates the instruction set into the actual instructions that the CPU executes. So you could say that x86 is the ultimate bytecode. And hey, for a while Mac OS X had PowerPC emulation support, and before that System 7 has 68k emulation support. On the other hand, people have implemented Java in hardware, so today's bytecode may become tomorrow's machine language, and vice versa.
edit: Can whoever downvoted please provide an explanation? This comment is on topic and polite; if you disagree, please explain, as I would be interested to know why. If there's something that's incorrect, a correction would be appreciated.
Would be interested in your thoughts about code generation -
I'm writing a VM, playing with ideas. I have wondered at this as an approach to software development: whenever you have a significant task to do, first build a virtual machine. Then create bytecode to satisfy your application.
You can have a rich instruction set to meet your needs - writing performant or hardware-oriented features in C, but getting easy access to them through your upstream high-level language. Highly portable, no library dependencies.
I'm fine at hand-editing bytecode, but code generation from a high-level language is still a mystery to me. I want to find a notation that gives me enough power to deal with high-level concepts, but for which it is easy to write a compiler to bytecode.
Currently options in mind: scheme (lots of resources, but might be too complicated - can tail recursion be done simply? adequate GC?); forth; some subset of C; something fancy with ometa.
Or, could I just write scheme functions to output machine code, and build my application logic in macros that on top of that. This bypasses the need for a conventional compiler.
I suspect that it's JVM, due to it's ubiquity in phones, and thought it might be worth pointing out since most people don't know that they have a JVM subset running on their SIM card. We really do have miniature bytecode interpreters running everywhere; and vulnerabilities can lead to security issues that allow your SIM card itself to be rooted[1]
[1]: http://www.extremetech.com/computing/161870-the-humble-sim-c...
I vaguely recall trying to get an old SPARCstation to boot and figuring out how to work the Forth shell (which is similar to what Grub is now) -- http://en.wikipedia.org/wiki/Open_Firmware
That was one of the first "small factor" pizza box machines: http://en.wikipedia.org/wiki/Pizza_box_form_factor
Amusingly, many of the older models with Open Firmware had no display drivers in the interpreter, so while you could start it, you had to talk to it through a serial port rather than using your keyboard and screen.
https://www.youtube.com/watch?v=3kEfedtQVOY
> Why is the overwhelming majority of common networked software still not secure, despite all effort to the contrary? Why is it almost certain to get exploited so long as attackers can craft its inputs? Why is it the case that no amount of effort seems to be enough to fix software that must speak certain protocols?
> The answer to these questions is that for many protocols and services currently in use on the Internet, the problem of recognizing and validating their "good", expected inputs from bad ones is either not well-posed or is undecidable (i. e., no algorithm can exist to solve it in the general case), which means that their implementations cannot even be comprehensively tested, let alone automatically checked for weaknesses or correctness. The designers' desire for more functionality has made these protocols effectively unsecurable.
EDIT: OK, it should be back up now!
ACPI is notoriously broken in many places - the OpenBSD dev's frequently had to do a lot of "bug for bug" hacks to talk to the hardware just how Windows did, in order for things to work.
As for bug for bug compat, that's really more an issue of broken bios. I.e., the acpi byte code is broken, not the implementation that interprets the byte code. Windows doesn't necessarily do anything crazy, it's the bios that asks "is this windows?" And then shits itself if the answer is no.
$ ps aux | grep acpi
turns up the following kernel process on my machine: root 663 0.0 0.0 0 0 ? S< Oct29 0:00 [ktpacpid]- OS/400 user space is also bytecode based, JIT compiled on first run or installation time.
- Inferno userspace applications coded in Lingo
- Native Oberon has implementations with the kernel modules were AOT and the remaining modules are JITed on load
- Lillith (Modula-2 workstation)
Microsoft also used p-code (http://en.wikipedia.org/wiki/Microsoft_P-Code) to reduce the code footprint in order to fit more of the big applications in the RAM which was limited then.
When we're still at Microsoft: http://en.wikipedia.org/wiki/Windows_Metafile_vulnerability "the underlying architecture of such files is from a previous era, and includes features which allow actual code to be executed whenever a WMF file opens. The original purpose of this was mainly to handle the cancellation of print jobs during spooling"
What do you mean? How did you think of it before?