SharePoint 2010 officially supported installing on Windows 7 (as a development environment), however 2013 is not supported on a Windows 8 OS, even for development.
SharePoint is designed to be installed on a Server environment, not a desktop OS (they have different features installed and configured).
If you intend to do SharePoint development, I suggest you create a VM (Windows 8 includes Hyper-V server, or you could use Virtualbox) and run SP2013.
That said, 4 GB RAM you will struggle for a dev VM. MS recommends much more RAM, and the Search and Distributed Cache services will not run on that amount of RAM.
One option you have is to use Windows Azure VMs - they have VM templates with SharePoint 2013 installed for devleopment purposes.
Another option is to use Office 365 (SharePoint Online), which is hosted in the "cloud," so you don't have to worry about configuring SharePoint, you can just use it.