Index: trunk/src/core/library.cc
===================================================================
--- trunk/src/core/library.cc	(revision 437)
+++ trunk/src/core/library.cc	(revision 438)
@@ -6,5 +6,4 @@
 
 #include "nv/core/library.hh"
-#include <string>
 
 #if NV_PLATFORM == NV_WINDOWS
@@ -74,17 +73,17 @@
     NV_LOG_NOTICE( "library \"", m_name, "\" : loading..." );
 
-	std::string name( m_name.data(), m_name.length() );
-	std::string ext( NV_LIB_EXT );
+	string128 name( m_name );
+	string_view ext( NV_LIB_EXT );
 
-	if ( name.length() < ext.length() || name.substr( name.length() - ext.length(), ext.length() ) != ext )
+	if ( name.length() < ext.length() || !name.ends_with( ext ) )
     {
-        name.append( ext.data(), ext.length() );
+        name.append( ext );
     }
 
-    m_handle = NV_LIB_OPEN( name.c_str() );
+    m_handle = NV_LIB_OPEN( name.data() );
 
     if ( m_handle == NULL )
     {
-		NV_LOG_NOTICE( "library \"", m_name, "\" : failed to open!" );
+		NV_LOG_NOTICE( "library \"", name, "\" : failed to open!" );
 		return false;
     }
Index: trunk/src/engine/program_manager.cc
===================================================================
--- trunk/src/engine/program_manager.cc	(revision 437)
+++ trunk/src/engine/program_manager.cc	(revision 438)
@@ -9,10 +9,9 @@
 #include "nv/core/logging.hh"
 #include "nv/lua/lua_nova.hh"
-
+#include "nv/io/c_file_system.hh"
 
 nv::program_manager::program_manager( context* a_context ) : m_context( a_context )
 {
-	m_vertex_head   = a_context->get_device()->get_shader_header();
-	m_fragment_head = a_context->get_device()->get_shader_header();
+	m_shader_head = a_context->get_device()->get_shader_header();
 }
 
@@ -20,22 +19,22 @@
 {
 	NV_LOG_DEBUG( table.get_string("id") );
-	std::string vsource;
-	std::string fsource;
-	std::string csource;
+	string_buffer vsource;
+	string_buffer fsource;
+	string_buffer header( m_shader_head );
 	if ( table.is_table("common") )
 	{
 		lua::table_guard common( table, "common" );
-		load_source( common, csource, "" );
+		header.append( "\n" + load_source( common, "" ) + "\n" );
 	}
 	{
 		lua::table_guard vtable( table, "vertex" );
-		load_source( vtable, vsource, m_vertex_head+"\n"+csource+"\n");
+		vsource = load_source( vtable, header );
 	}
 	{
 		lua::table_guard ftable( table, "fragment" );
-		load_source( ftable, fsource, m_fragment_head+"\n"+csource+"\n" );
+		fsource = load_source( ftable, header );
 	}
 
-	nv::program program = m_context->get_device()->create_program( string_view( vsource.c_str(), vsource.size() ), string_view( fsource.c_str(), fsource.size() ) );
+	nv::program program = m_context->get_device()->create_program( vsource, fsource );
 	return add( program );
 }
@@ -46,10 +45,11 @@
 }
 
-void nv::program_manager::load_source( lua::table_guard& table, std::string& out, const std::string& append )
+nv::string_buffer nv::program_manager::load_source( lua::table_guard& table, const string_view& append )
 {
-	out = append;
+	c_file_system fs;
+	string_buffer out( append );
 	if ( table.is_string( "files" ) )
 	{
-		out += nv::slurp( table.get_std_string( "files" ) );
+		out.append( fs.slurp( table.get_string( "files" ) ) );
 	}
 	else if ( table.is_table( "files" ) )
@@ -59,7 +59,7 @@
 		for ( uint32 i = 1; i <= count; ++i )
 		{
-			std::string include( inctable.get<std::string,uint32>(i) );
-			if ( i == count ) out += "#line 1\n";
-			out += nv::slurp( include );
+			const_string include( inctable.get<const_string,uint32>(i) );
+			if ( i == count ) out.append( "#line 1\n" );
+			out.append( fs.slurp( include ) );
 		}
 	}
@@ -67,10 +67,12 @@
 	if ( table.is_string( "file" ) )
 	{
-		out += "#line 1\n" + nv::slurp( table.get_std_string( "file" ) );
+		const_string data = fs.slurp( table.get_string( "file" ) );
+		out.append( "#line 1\n" + data );
 	}
 
 	if ( table.is_string( "source" ) )
 	{
-		out += table.get_std_string( "source" );
+		out.append( table.get_string( "source" ) );
 	}
+	return out;
 }
Index: trunk/src/gfx/texture_font.cc
===================================================================
--- trunk/src/gfx/texture_font.cc	(revision 437)
+++ trunk/src/gfx/texture_font.cc	(revision 438)
@@ -29,6 +29,6 @@
 }
 
-texture_font::texture_font( texture_atlas* atlas, const char * filename, float size )
-	: m_atlas( atlas ), m_filename(filename), m_size( size ), 
+texture_font::texture_font( texture_atlas* atlas, const string_view& filename, float size )
+	: m_atlas( atlas ), m_filename( filename ), m_size( size ),
 	m_height(0), m_linegap(0), m_ascender(0), m_descender(0),
 	m_hinting( true ), m_filtering( true ), m_rlibrary( nullptr ), m_rface( nullptr )
@@ -53,5 +53,5 @@
 	NV_CHECK_FREETYPE_ERROR( error, "error on FT_Init_FreeType, code - ", error );
 
-	error = FT_New_Face( reinterpret_cast<FT_Library>(m_rlibrary), filename, 0, reinterpret_cast<FT_Face*>(&m_rface) );
+	error = FT_New_Face( reinterpret_cast<FT_Library>(m_rlibrary), filename.data(), 0, reinterpret_cast<FT_Face*>(&m_rface) );
 	NV_CHECK_FREETYPE_ERROR( error, "error on FT_New_Face, code - ", error );
 
Index: trunk/src/gl/gl_device.cc
===================================================================
--- trunk/src/gl/gl_device.cc	(revision 437)
+++ trunk/src/gl/gl_device.cc	(revision 438)
@@ -17,9 +17,9 @@
 gl_device::gl_device()
 {
-	m_shader_header  = "#version 120\n";
+	m_shader_header.append( "#version 120\n" );
 	for ( auto& i : get_uniform_factory() ) 
-		m_shader_header += "uniform "+datatype_to_glsl_type( i.second->get_datatype() )+" "+ std::string( i.first.data(), i.first.size() ) +";\n";
+		m_shader_header.append( "uniform "+datatype_to_glsl_type( i.second->get_datatype() )+" "+ i.first +";\n" );
 	for ( auto& i : get_link_uniform_factory() ) 
-		m_shader_header += "uniform sampler2D "+std::string( i.first.data(), i.first.size() ) +";\n";
+		m_shader_header.append( "uniform sampler2D "+i.first +";\n" );
 }
 
Index: trunk/src/gl/gl_enum.cc
===================================================================
--- trunk/src/gl/gl_enum.cc	(revision 437)
+++ trunk/src/gl/gl_enum.cc	(revision 438)
@@ -354,5 +354,5 @@
 }
 
-std::string nv::datatype_to_glsl_type( datatype type )
+string_view nv::datatype_to_glsl_type( datatype type )
 {
 	switch( type )
Index: trunk/src/io/c_file_system.cc
===================================================================
--- trunk/src/io/c_file_system.cc	(revision 437)
+++ trunk/src/io/c_file_system.cc	(revision 438)
@@ -11,4 +11,5 @@
 using namespace nv;
 
+
 c_file_system::c_file_system()
 {
@@ -21,7 +22,7 @@
 }
 
-bool c_file_system::exists( const char* fpath )
+bool c_file_system::exists( const string_view& fpath )
 {
-	FILE* file = ::fopen( fpath, "rb" );
+	FILE* file = ::fopen( fpath.data(), "rb" );
 	if ( !file )
 	{
@@ -32,12 +33,23 @@
 }
 
-stream* c_file_system::open( const char* fpath, const char* fmode /*= "rb" */ )
+stream* c_file_system::open( const string_view& fpath, const string_view& fmode /*= "rb" */ )
 {
-	NV_ASSERT( fpath != nullptr && fmode != nullptr, "Bad parameters passed to open" );
-	FILE* file = ::fopen( fpath, fmode );
+	NV_ASSERT( !fpath.empty() && !fmode.empty(), "Bad parameters passed to open" );
+	FILE* file = ::fopen( fpath.data(), fmode.data() );
 	if ( !file )
 	{
 		return nullptr;
 	}
-	return new c_stream( file, fpath );
+	return new c_stream( file, fpath.data() );
 }
+
+nv::const_string c_file_system::slurp( const string_view& path )
+{
+	stream* fstream = open( path, "rb" );
+	if ( !fstream ) return const_string();
+	uint32 size = fstream->size();
+	const_string result( nullptr, size );
+	fstream->read( const_cast<char*>( result.data() ), size, 1 );
+	delete fstream;
+	return result;
+}
Index: trunk/src/lua/lua_raw.cc
===================================================================
--- trunk/src/lua/lua_raw.cc	(revision 437)
+++ trunk/src/lua/lua_raw.cc	(revision 438)
@@ -30,10 +30,10 @@
 	{
 		size_t l = nv::uint64_to_buffer( buffer, nv::uint64( lua_touserdata( L, idx ) ) );
-		return nv::string_view( buffer.data(), buffer.size() );
+		return nv::string_view( buffer.data(), l );
 	}
 	else if ( type == LUA_TNUMBER )
 	{
 		size_t l = nv::f64_to_buffer( buffer, lua_tonumber( L, idx ) );
-		return nv::string_view( buffer.data(), buffer.size() );
+		return nv::string_view( buffer.data(), l );
 	}
 	return "UNKNOWN!";
Index: trunk/src/stl/string.cc
===================================================================
--- trunk/src/stl/string.cc	(revision 437)
+++ trunk/src/stl/string.cc	(revision 438)
@@ -12,17 +12,9 @@
 #include <cstdlib>
 #include <fstream> // for slurp only
+#include <sstream> // for slurp only
 
 using namespace nv;
 
 //static const double s_power_10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 };
-
-std::string nv::slurp( const std::string& filename )
-{
-	std::ifstream input( filename );
-	//		if ( !input.is_open() ) NV_THROW( std::runtime_error, "File "+filename+" not found!");
-	std::stringstream sstr;
-	while ( input >> sstr.rdbuf() );
-	return sstr.str();
-}
 
 static inline void string_reverse( char* begin, char* end )
