Tuesday, March 31, 2009

Wednesday, March 25, 2009

Java, Mono, Python, and SIMD

I've been interested in Mono's direct support for SIMD operations. As far as I can tell, it does make a difference in performance. Even things like NumPy (for Python) effectively use SIMD under the covers, if I understand correctly. But, apparently, we don't need support for SIMD in Java, because HotSpot will (at some magical point) make all the pain go away.

If you can tell, I'm disappointed in the Sun response to the problem. And how hard would it be to recognize when low-level 'for' loops are parallelizable with SIMD operations? My guess is that it would be very difficult to recognize automatically compared with the ease of writing code in parallel form to begin with.

I'm rather convinced that basic, and maybe some additional advanced, matrix operations ought to be in the core JRE. After some time in MATLAB, I'm convinced it's a better level of abstraction than 'for' loop everywhere, anyway. And I like pure Java. If it requires native code outside the JRE, it's uncool. I'm also tired of having no clear path for matrix support in Java.

If scientific work (or other number crunching such as for games) takes people to MATLAB or Python or Mono or C, that leaves a huge hole for Java.

Maybe someday they'll care about this hole. Really, a matrix absraction layer allows for easier, high level coding and easier optimization. Pretty please, Sun or IBM or whatever?

Bonus points for including GPGPU implementations and abstractions.

Wednesday, March 18, 2009

Web in Our Minds

Hmm. Been thinking a lot recently about how much of our symbol handling in our minds might not be too unlike the world wide web. Not exactly the same either, though. And there need to be ties between rich physical data and any "symbols".

Also thinking that our hypothesis representation (problem reduction?) space ought to be Turing complete. Not sure that this is related to symbol handling.

Wednesday, March 11, 2009

Teaching Expressions

I've found in recent days that many students can understand expressions better when built up one at a time. For example:

int i = 5;
if (Math.sqrt(i + 1) < 4.5) { /* ... */ }

So, the idea is to work outward with types:
  • What's the type of expression 'i'? int
  • What's the type of expression '1'? int
  • What's the type of expression 'i + 1'? int (then converted to double)
  • What's the type of expression 'Math.sqrt(i + 1)'? double
  • What's the type of expression '4.5'? double
  • What's the type of expression 'Math.sqrt(i + 1) < 4.5'? boolean (required for if)
Going over this in front of students and letting them give the answers seems an effective way to teach the concepts (for some people). Showing assignment, boolean operators, and other such examples can also be useful.

Wednesday, March 4, 2009

Build Objects looks interesting

I haven't tried it out yet, but Build Objects looks like the closest thing today to my Can Has Build idea that I would like much better than either Ant or Maven.

If you are looking for a better mousetrap, Build Objects is something you might want to consider.

Bullet for Physics, I think

The more I look at and think about different options, the more I'm convinced that the physics platform with legs is Bullet. And sadly, I don't think it's JBullet. That's too bad, because I definitely prefer Java. Maybe someday, native DLLs will just run as Java transparently, but until then ...

(Side note, I'm getting less convinced on using Blender as the Bullet wrapper for simulations, but maybe someday on that, too.)