Hacker News new | ask | show | jobs
by sitkack 3746 days ago
Ok, maybe it isn't a question of C and native, but access to low level semantics, memory layout and specialized instructions. The majority of programs and programmers are better served by going with a higher level, easier to parallelize semantics than dropping down to architecture specific features. I am thinking Grand Central Dispatch vs assembler.

I would argue that the low level work you are doing should be done in a macro or compiler.

http://www.graphics.stanford.edu/~hanrahan/talks/dsl/dsl1.pd...

http://www.graphics.stanford.edu/~hanrahan/talks/dsl/dsl2.pd...

Pat Hanrahan makes a compelling argument for using special purpose DSLs to construct efficient performant code that takes advantage of heterogeneous hardware.

See the Design of Terra, http://terralang.org/snapl-devito.pdf

1 comments

Thanks! This are really useful. (I'm actually now making a small dsl for distributing work on accelerators.)

I personally really like the idea from the the Halide language, having one language for algo, another for how the computation is done. If something like that could be made general purpose it would be very useful.

http://halide-lang.org/

>should be done in a macro.. Encourage c programmers to use macros is like encouraging alcoholics to drink :) But I guess you didn't think about pre processor macros.

I find halide really interesting. Like the split between control and data planes. It made me realize we conflate things and don't even realize that they can be separated.

>...macro

Yeah, I didn't have preprocessor macros in mind. ;*| But wonderful, AST slinging hygienic Macros!

Take a look at http://aparapi.github.io/ it one of the best examples of making OpenCL a first class citizen in Java.