[LLVMdev] Portable I/O

Dustin Laurence dllaurence at dslextreme.com
Fri Feb 12 16:33:22 PST 2010


On 02/12/2010 02:02 PM, Michael Ness wrote:

> Dustin, are the routines you wrote open source or do you know if there
> is already a project that provides such a portable interface to libc for
> LLVM? If not, I'll write my own routines, but if there is a way to adopt
> a common standard or avoid reinventing the wheel I'm all for it.

I know of no project for this sort of thing--I just solved my own 
problems as I went, and only did what I needed (or what I thought I 
needed at the time) for my experiment.  I put it under the GPL3 just so 
I didn't release code in the wild with ambiguous terms, so you're 
entitled to use it without my permission; the public GIT repo is on github:

http://github.com/dllaurence/Nil

and while documentation wasn't a big priority the README should at least 
tell you which files are what.  You want to look at system_c.c for the 
little C wrapper functions and system.llh for the llvm 
declarations--keep in mind that I'm using CPP though.  c_defs.c is how I 
import type definitions and the like--it writes an llvm header with the 
correct LLVM definitions for whatever the local machine uses for stuff 
like size_t, ptrdiff_t, and the like.

If you want to know what sort of mad project it is, the developer's blog 
is at

http://github.com/dllaurence/Nil

I hope to get back to it and put in the last bits to make it Turing 
complete next week (basically it needs user-defined symbols and lambda 
expressions).

Feel free to contact me about it if it isn't making sense or you want to 
know why I did some crazy thing.

Dustin



More information about the llvm-dev mailing list