6 ms·
VMIR – Virtual Machine for LLVM Intermediate Representation
- jevinskie 11y agollli? Lightweight LLVM Interpreter? This is very cool since it doesn't depend on the (large) LLVM library. I'm eager to try it out! Edit: I don't see a license. May I kindly suggest WTFPL or something similar?
- dmm 11y agoISC is the shortest permissive free-software license with a warranty disclaimer under current law. Here it is: Copyright (c) Year(s), Company or Person's Name Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- ferbivore 11y agoIt's MIT-licensed. Look at src/vmir.c.
- dsp1234 11y agoNote that some of the code[0] is copy-pasta from the LLVM source[1] with the copyright section missing which is likely a license violation. [0] - https://github.com/andoma/vmir/blob/master/src/bitcode.h https://github.com/andoma/vmir/blob/master/src/bitcode.h [1] - https://llvm.org/svn/llvm-project/llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h https://llvm.org/svn/llvm-project/llvm/trunk/include/llvm/Bi...
- andoma 11y agoRight, my bad. Though there is hardly any 'code' in there. I copied the defines from LLVM initially as I couldn't find any good documentation except in the header file. I suppose I will have to retype it or something :-)
- jevinskie 11y agoThanks Oracle/Google. :) Sorry, it is just that I write code that ends up passing hands through multiple entities. Each time one entity has to include an attribution notice, their willingness to include the library drops dramatically. I'm in the camp of "I'm glad if anybody includes my code", and I still submit bug reports/patches to upstream projects with "public domain" licenses, even though I am not required to. It just makes sense, provided your employer recognizes the value it brings.
- dsp1234 11y agoOr you could just reproduce the original license, which is all that's required. It's really the stripping of the license out of the file that is the problem, since the original LLVM license specifically states that the license grant is incumbent upon keeping the license text in place. Even though in reality you copied/pasted the text out in to a new file, it's really the equivalent of removing the license text and all of the other code you didn't need.
- DannyBee 11y agoPlease don't use WTFPL, unless you enjoy getting sued over implied warranties, or arguing with people over what rights they've really given you, or ...
- n00b101 11y agoWhat is the difference between the JIT here and LLVM's own MCJIT (besides the fact that this JIT is currently only supported on 32 bit ARM)?
- bluejekyll 11y agoIn addition to this question, it would be nice if there was a "why" section in the readme. It's not clear to me what the intention of this project is. Was it just for fun? Is it for a school project? Do you want to have some way of running cross platform? Just curious, I love projects like this, just like to understand what the motivation is.
- andoma 11y agoVMIR's Author here. The reason I started this was to add support for "binary" plugins to my media player/center (http://movian.tv http://movian.tv). Movian runs on some platforms which does not allow loading code runtime (Google NaCl is one). I haven't gotten that far yet though. Still fixing stuff and testing what kind of performance I can get out of it. Also I did it for fun and, as always, one learns a lot along the way.
- izym 11y agoSlightly off-topic: Does Movian support theming? Looks like a great media center.
- caf 11y agoSpecifically, nacl-targeted IR.
- michaelmior 11y agoI'm curious why the author chose to include separate C files instead of just compiling and linking multiple object files.
- andoma 11y agoBasically to avoid polluting symbol namespace without having to have very long function names. Also it gives the compiler a good chance of inlining without having to resort to LTO. Eventually I might do some "make dist" thing that just concats it all into one amalgamation file similar to projects like Sqlite and Duktape.
- sklogic 11y agoI was thinking of building something like this, a lightweight IR engine. IR is designed to be exceptionally crappy for a direct interpretation, so I was thinking of converting it to an intermediate stack-based machine first (and then do an indirect threading).