Friday, July 24, 2009

JITting native code

Although arguably it hasn't happened yet, JIT technology can theoretically exceed statically compiled C code, as far as I know.

What if there were a way to take execution of a normal (perhaps compiled from C) native program, trace its execution paths, and then do in-lining and whatever else JIT functions upon it? Perhaps just treat the x86 like any other bytecode and emulate it, except or the JIT'd parts which are more-or-less directly copied?

Although the problem with that is that emulating x86 (even on x86) is probably way slower than emulating normal language bytecodes, because x86 instructions are a lot more primitive and involve the architecture's peculiarities of register usage, etc. But I wonder if there's a way to trace paths without emulating it? It seems that somehow V8 does that, because they claim that it never executes bytecode. I don't really understand it myself.

*update*
idea:
modify the compiler to include calls in the (originally statically compiled) code that update an object by telling it that it execution passed through that code. then another thread can analyze this data and based on waht's there, and perhaps based on other meta-data included in the compiled program such as function boundaries and so on (if not even a complete or semi-complete bytecode, that's never executed), can take those paths and do things like in-lining, condition guards, moving variables to registers, and so on by creating new code sections in memory.

Friday, July 10, 2009

Better LEDs?

I heard that one of the things making LEDs inefficient is the fact that, since they're encased in plastic, half the light is refracted back in off the edges of the plastic. That's a 50% reduction in efficiency..

Why can't we just put LEDs inside glass bulbs (or, for that matter, plastic bulbs) like we do incandescent lights? That is, nothing contacting the surface of the diode.

Another idea: why are we using many small conventional-sized LEDs to make up light sources that actually put out a decent amount of light? Why don't we just make single LEDs with longer and/or wider diodes to put out more light? Maybe put them in larger zig-zag patterns?

Not that I would buy LED lighting anyway, until the QLEDs come out.

I also heard something about using salmon sperm to intensify LED light, something about trapping photons within the polymers or whatever. I'm not sure how I feel about us sexually violating salmon for our energy-efficient lighting purposes, but I don't see a reason why we can't synthesize the critical, uhh, ingredient in our labs. Once I mixed a bunch of soap with a little bit of hot water and let it cool for a while. ..That stuff was pretty damned gooey.

So here's the ideal solution:

* Quantum Dot LEDs
* Encased in a vacuum
* Widened/elongated actual diodes
* Synthesized polymers or, alternatively, a lot of soap, water and time.

There, ridiculously energy-efficient natural light at the color temperature of your choice.

I suspect that what would be even better, though, is thermally isolated, adjustable-temperature, actual blackbodies..

Thursday, July 09, 2009

Idea for a nutrition website

The website has a database of foods and which nutrients they contain (not just on the vitamin and mineral level, but also proteins, enzymes, glyconutrients, etc. etc.), and knows in what proportions the body needs all these nutrients

Then the user can put in things they definitely want to eat, and how much of them, and
the website can fill in for them what the rest of their diet needs to consist of to get the full gamut of nutrients. Then from those suggested foods they can also exclude certain things and/or choose between options and maybe specify how much of what they want to eat, which it then reacts to with further suggestions, and so on.

A wide variety of foods is really needed for good health, and hopefully the website's flow of suggestions would reflect that fact.

The person should probably be able to, or maybe have to, put in certain parameters regarding their body, such as weight, height, gender, age, fat index, blood pressure, cholesterol, etc.

Perhaps they can also put in specific areas they want to improve, such as "hair, skin and nails"

Allegedly nutrition isn't as simple as just ingesting this or that nutrient, in that certain nutrients and together and one might not be effective without the other. The site should also be aware of these interdependencies.

The user should be able to specify whether they want only natural foods, only vegetarian, only vegan, no red meat, only live foods, etc.

They might also should be able to include allergies to specific substances, lactose intolerance, etc., although maybe the same effect would be just as easily or easilier achieved through the exclusion of specific suggested foods.

It would be nice if this website didn't just have a database of staple foods, but also a vast database of specific products. And that should also come with the ability to exclude certain substances like polyunsaturated fats, aspartame, partially hydrogenated oils, high fructose corn syrup, sucralose, etc. — although the website could also exclude all such things, or least the really bad ones like what I just mentioned, by nature.

Though the specific products idea carries the problem of certain products only being available in certain areas and certain grocery store chains.

Another consideration is that, while certain substances (like sodium) are listed in terms of specific quantities, most of the ingredients, even though they're listed in order of quantity, don't specify their actual amounts. So to really effectively be able do the products idea, the website's owners would have to "rock the boat", in a sense, and get manufacturers to release specific ingredient amounts, by making the deal with them that, in exchange for releasing that data, their products can be suggested within, and thus promoted by, the world's most useful dietary website.