Rice, the programming language by Dennis King.
Okay so let's get one thing out of the way first, why Rice?... the answer to that question is quite simple, I called the language Rice because I love rice, I mean I really really love to Eat rice, I'm obsessed with rice, hell, sometimes I'll even go as far as having 6 bowls of rice a day. I absolutely adore rice in its simplest form β plain, dry, and unsalted. There's something about its unadorned simplicity that truly captivates me. The texture of each individual Grain as it dances on my taste buds is pure bliss. The subtle nuttiness of the rice shines through, unhindered by any seasoning distractions. It's almost as if every mouthful takes me to a place of culinary enlightenment. Many people find this preference unusual, but I revel in the natural flavors and wholesome essence of plain rice. There's a certain purity to it, a blank canvas awaiting my appreciation. It literally complements any dish I pair it with, acting as a neutral foundation for flavors to build upon. I relish the opportunity to let the rice take center stage, allowing me to truly appreciate its humble and unpretentious nature. Just plain, dry and unsalted rice, that's the way I love it and that's the best way to serve it.
Just give me a Bowl of rice and I'm happy.
Rice is a simple and lightweight programming language not designed for basic arithmetic operations, but is designed for string manipulation, and console output. It aims to provide an intuitive and readable syntax similar to Java while offering an incredibly reduced set of features. Software engineers often enjoy challenging problems and coming up with complex solutions to those problem, it's in our DNA to be complex, it feels great to demonstrate our technical skills and expertise, to showcase our knowledge and abilities to our peers in the industry... but complex doesn't always have to be the solution. And that's the case with Rice. Rice is not complex, Rice is the "basic b*tch" of programming languages. Rice is the odd one out. Rice is for dummies like myself. Rice is for anyone that thinks building software can only done by "geniuses", which is a common misconception about software development. Rice is incredibly flawed but there is a certain beauty to it. It was not created by a genius but it was created by a man with a vision.
Nurturing a child's interest in technology from an early age is crucial in today's rapidly advancing world. The digital age has transformed the way we live, work, and communicate, and it's becoming increasingly essential for individuals to have a strong foundation in technology. Kids are really smart these days, I mean children as young as 4 already know how to read and operate certain technologies. And I see an opportunity to capatilise on this. In this context, I hope saying "capitalise" doesn't sound wrong but hear me out. Because Rice is so easy to understand, I think it could be a great intro to programming for these young ones. As I mentioned earlier, kids are smart and I strongly believe that they would easily grasp Rice. Rice could be the language that ignites the spark of curiosity and passion for programming in young minds. It could serve as a gateway to the world of technology, enabling children to take their first steps into the realm of coding with ease and excitement. I want Rice to become a simple and accessible platform for learning. Rice could empower kids to explore their creative potential, experiment with ideas, and see tangible results quickly. But most importantly I want Rice to promote inclusivity, especially in the society that I live in, here in South Africa. I want to ensure that children from all backgrounds and resource levels can participate in the joy of programming, breaking down some barriers that might prevent some children from accessing technology education, allowing a wider audience to benefit from the wonders of coding. Rice is very limited and as children outgrow these limitations, they hopefully will seek to expand their coding horizons. Rice will serve as an excellent stepping stone for young learners to transition to more advanced languages and concepts later on. Once they have a solid foundation in Rice's simplified syntax and logic, they can easily adapt to languages that support arithmetic expressions. Rice could even help to address the gender gap in technology and encourage more young girls to enter the world of programming. Its simplicity and approachability could create an environment where all children, regardless of gender or background, feel comfortable and motivated to participate. And hopefully in the long run, Rice could contribute to a future workforce that is more technologically adept and innovative. By making Rice accessible to children as young as 5, Rice could foster a generation of young problem-solvers, inventors, and entrepreneurs who are unafraid to tackle the world's most pressing issues with the help of technology. This could have long-term benefits in terms of developing computational thinking, problem-solving skills, and creativity from an early age. By nurturing the interests of young children and providing them with an accessible and exciting entry into programming, Rice could play a pivotal role in shaping a brighter, more technologically proficient future for all.
Rice programs follow a structure similar to Java:
Rice {
Cook main() {
// Program code goes here
}
}
The main reason behind this idea was that Rice should be structured in a way that follows the concept or the process of actually cooking rice. You see this clearly if you pay attention to the structure of a Rice program.
Rice only supports two data types.
- bowl: Represents integer values.
- grain: Represents string values.
You can declare variables using the following syntax:
dataType variableName = expression;
After cooking your rice, you wanna Eat it, right??
Eat.print(expression)
To print output to the console, use the Eat.print statement:
Haha, probably gonna get some slack for this one, Rice does NOT support basic arithmetic expressions.
Arithmetic expressions can be written using the following syntax:
bowl result = expression1 operator expression2;
Here's an example of a Rice program.
Rice{
Cook main(){
grain message = "David Guetta's Sunshine is easily one of his greatest hits!!";
bowl year = 2012;
Eat.print("What a great track!!");
}
}
Technically Rice is not its own unique programming language, it was created using ANTLR and JAVA and so it's heavily reliant on them.
ANTLR is a powerful parser generator that allowed me to define the grammar for Rice. It takes Rice's grammar specification as input and generates lexer and parser code in various programming languages, including Java. The generated lexer and parser are responsible for transforming the source code into a parse tree, which represents the hierarchical structure of the code.
The language I created using ANTLR is a custom programming language. Although, it's not entirely new because it relies on existing components (ANTLR and Java) to function. However, it does have its unique syntax, semantics, and features. Rice's grammar, which defines its syntax, is specified in ANTLR's grammar file format. The grammar file contains rules that describe how the language's statements, expressions, and other constructs should be structured.
Java is a general-purpose programming language that I chose as the target language for Rice. This means that the code written in Rice will ultimately be translated into equivalent Java code through the process of parsing and translation.
The relationship between Rice, ANTLR, and Java can be explained through the following steps:
So, Rice relies on ANTLR to define its grammar and generate the necessary lexer and parser code in Java. The parsed code is then translated into equivalent Java code, which can be executed using the Java Virtual Machine. This relationship has allowed me to create Rice while leveraging the flexibility and robustness of Java.
As I mentioned before, Rice relies on JAVA, so to execute a Rice program you will need to have JAVA installed.
Rice{
Cook main(){
grain complain = "ahh man writing the documentation for this is taking too long!";
bowl age = 23;
Eat.print("I wonder where my birth certificate is.");
}
}
One unique aspect about Rice is that it's written in its own file, so you don't have to write Rice code in some main java class file. The code above will be executed in its own file with an extension of .rice
. All you have to do to run a Rice program is to switch to the main java class file and hit run!!
The program above will print the following output to the console:
Variable declaration: complain = "ahh man writing the documentation for this is taking too long!"
Variable declaration: age = 23
Printing: "I wonder where my birth certificate is."
I hope up to this point everything makes sense.
Help me make Rice an official and a recognised programming language.
Dennis King.