Bedrock is an extremely advanced and powerful framework for developing beautiful, easy to use ComputerCraft programs. Not only does it make for a more pleasant experience for the user, by coding programs with Bedrock removes the need for you, the developer, to wrangle with low level aspects of programs. With Bedrock file sizes are also significantly lower than previously due to huge amounts of code, that would have previously made your program huge bigger, being in one central API. A single line of code is all that is needed to download and install Bedrock, and if Bedrock was already installed by another program it will use that version, saving precious disk space.
Bedrock is designed to be similar to existing interface frameworks such as Apple’s Cocoa, the framework used to develop the majority of iOS and OS X. I’m sure that it will also be similar to others such as .NET and possible Java, but I’m not very familiar with them. If you’ve used these in the past, Bedrock should be pretty easy to pickup, if you haven’t, don’t worry. It may take some time to work it out, but once you do you’ll be able to create better programs in record time.
It's hard to explain just what Bedrock is really. Take a look at the tutorial (link at the bottom of the post) for a more detailed description and example code.
What objects does it support?
- Buttons
- CollectionViews (think the icon view in OneOS's Files)
- ImageViews
- Labels
- ListViews
- Menus
- ProgressBars (including multiple values and colours, think the storage usage bar in About OneOS)
- ScrollBars (these are automatically handled by ScrollViews though)
- ScrollViews
- Separator (just single line)
- TextBox
- Windows
What are the benefits of Bedrock?
Bedrock is designed to be very quick and easy to use, yet very powerful. It only takes a matter of minutes to learn how to use it and will save you hours in the long run.
One of Bedrock's main goals is to reduce the amount of code you need to write. I've personally found that programs I use Bedrock are normally a third the number of lines, and that doesn't include having to write the APIs in the first place.
What are some programs made with Bedrock?
If you made a program with Bedrock let me know, I’ll add you to the list!
- OneOS - OneOS and most of it’s programs were entirely coded using Bedrock. Anything that OneOS does you can do with ease.
- Your next program?
Installation/Download
If you want to just take a look at the code you should use the GitHub repo. https://github.com/oeed/Bedrock
Installation is very easy, simply add this line to the top of your file and it will automatically download and load the API.
local bedrockPath='/' if OneOS then OneOS.LoadAPI('/System/API/Bedrock.lua', false)elseif fs.exists(bedrockPath..'/Bedrock')then os.loadAPI(bedrockPath..'/Bedrock')else if http then print('Downloading Bedrock...')local h=http.get('http://pastebin.com/raw.php?i=0MgKNqpN')if h then local f=fs.open(bedrockPath..'/Bedrock','w')f.write(h.readAll())f.close()h.close()os.loadAPI(bedrockPath..'/Bedrock')else error('Failed to download Bedrock. Is your internet working?') end else error('This program needs to download Bedrock to work. Please enable HTTP.') end end if Bedrock then Bedrock.BasePath = bedrockPath Bedrock.ProgramPath = shell.getRunningProgram() end
How to use it.
Bedrock is quite different to most other APIs/frameworks. I've made a very sizeable tutorial which I highly recommend you read. At this stage the tutorial is the only documentation.