Hacker News new | past | comments | ask | show | jobs | submit login

What kind of products allow users to compile and run custom C code, but would feel constrained by the GPL? Any examples (OSX excluded)?



It has nothing to do with "custom C code". Any tool with a custom language (or equivalent) that wants a runtime JIT for the language and code compilable to LLVM IR would need to link in the compiler libs to do that. Custom DSLs are everywhere.

For example, OpenShadingLanguage compiles shaders on the fly as part of a physically-based renderer, and then JITs them at runtime with LLVM. Linked in are the LLVM libs and a bunch of C code that is converted to LLVM IR and accessed by the shaders. The whole lot is linked and JITd together, enabling interprocedural analysis, inlining and a bunch of other compiler optimizations (e.g. constant folding). The resulting shaders are about 25% faster than their previous, hand-coded C shaders.

IOW, lots of products benefit from having a compiler toolchain at runtime they can link with their program. GPL license or not, GCC isn't made to do that.


Suppose you're writing an IDE, and you want to use the clang code to do the heavy lifting of making your editor aware of your program's AST, so that you can easily colorize it, provide in-line warnings & errors, and offer fix-it suggestions.


XCode. GCC is now under GPLv3. I've got a feeling the patent issues in v3 give Apple lawyers a serious rash.

Also with it being under BSD, they can write their own closed source extensions or reuse portions of their code in their own projects.


I'm working on an Apache-licensed product that uses some of it's libraries for code generation.


A few months ago there was a discussion about the problems with the licenses in the Racket Users mailing list:

(first mail) http://lists.racket-lang.org/users/archive/2012-April/051303...

(most relevant mail) http://lists.racket-lang.org/users/archive/2012-April/051319...

They use the LGPL license. The idea is that you can make closed source programs that link to the Racket system as a library, but you must provide a version that is linkable to newer versions of Racket. But in Racket the macro expansions are a fundamental part so the more strict interpretation means almost that you must provide the original source code in plain text.

I don't know enough about licenses, perhaps this is only FUD. And my impression is that the intensions of the Racket creators is that closed source programs in Racket are allowed, but this looks like a gray area.

And the GPL license is more restrictive, but C/C++ has many less macros/templates than Racket.


Cloudera Impala uses LLVM to generate code optimized for the specific query it is running (basically compiling away all the generalness around how large records are, etc). Some kind of native code generation is apparently standard practice in high-performance query engines that are written in languages that don't have a JIT.


Why would it have to be "C code"? LLVM can compile any kind of code with the appropriate front-end. For example, Apple uses it in their OpenGL pipeline, in the (previously Apple sponsored) MacRuby, etc.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: