On Sun, 2007-07-08 at 15:07 -0400, Sandro Magi wrote:
> I'm looking into creating a VM for a language I'm building, and was
> going to base it on LLVM which is written in C++. I'd rather not have
> to deal with C++ though, 

me either .. :)

> and since Felix can natively integrate with
> C++ with much stronger typing, I'm wondering whether it would be a
> good fit for this application.
> 
> In particular, my VM requires control over allocation (ie. no implicit
> allocations), and clearly performance is important in this instance.
> 
> To clarify the motivation Re: allocations, I'm looking at building a
> resource-aware VM, and thus each allocation must be booked to specific
> agent. If the VM performs implicit allocations, then the VM is open to
> a denial of resource attack against the memory subsystem since any
> malicious agent can induce these implicit allocations until memory is
> exhausted.

Interesting. If you're using Felix to execute bytecode, that is 
a separate concern from memory requests *by* that bytecode.

Felix itself may or may not allocate it's own memory, depending
on how you write your application: you can make Felix generate
plain-old-C like code (no heap allocations).

The Felix GC itself is split into an abstract class and 
an implementation, and the allocator likewise is a separate
abstract class and implementation.

The standard allocator implementation is malloc-free.

There are several possible ways you might approach this whole thing.

The 'minimalist' technique is to just use the compiler flxg to
generate C++ source code with your own C++ support libraries
and driver code.

In that case, if you need to do something you can't currently
do I can probably modify the compiler to support your requirements.

However, it probably isn't necessary. Felix has a SVC instruction,
which is a 'service call' or 'kernel call' which an application
can use to make requests of the driver .. the driver is basically
a user space operating system.

The svc_general requests are abstract, they can do anything,
independently of the driver. We use these requests to open
sockets, do socket I/O etc.

My guess on allocation is you use these (slow, asynchronous)
requests to fetch blocks of memory from a memory server,
where you log the request, then you use a fast synchronous
suballocator to manage that memory for each agent.

BTW: Felix has Judy arrays built in. That's an associative
(sparse) array or pointers or bits with O(1) performance 
for all operations. It's highly tuned for good cache performance. 
The Felix GC is currently using it. (blurb on judy.sf.net)



-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to