Skip to content

teo67/Radish

Repository files navigation

RADISH

{ like the vegetable. }


Installation

Radish's website provides in-depth instructions on how to install Radish to your computer based on the OS. If you're using this repository on MacOS, there's also an install.sh file that runs the scripts necessary (use sudo bash install.sh to grant admin permissions, as the file needs access to usr/local).

So what's it all about, anyway?

Radish is an easy-to-learn, object-oriented programming language written in C#. If you know JavaScript, you know Radish. However, Radish has a few of its own quirks to keep in mind (don't ask why these exist)

  • To declare a variable, use "dig" or just "d"
    Example: dig name
  • To set the value of a variable, use "plant" or "p"
    Example: dig name plant "Theo"
  • Radish currently supports only multiline comments, just start and end your comment with #
    Example: # this is a comment #
    As a side note, Radish is completely linebreak blind. That's right, no semicolons. You can write as many statements on the same line as you want!
  • Functions are declared using either "tool" or "t"
    Example: dig sayHi plant tool(name) { holler(name) }
    Oh yeah, forgot to mention that the print function is called holler.
  • There are a few other details, but you'll get used to them along the way.
In terms of OOP, perhaps a demonstration would be the best way to explain. See if you can figure out what this code does:
dig FunkyList plant class {
 dig stored
 dig constructor plant tool(arr) {
  this.stored plant arr
 }
 dig get plant tool(index) {
  if(index % 2 == 1) { # for odd numbered requests #
   harvest "no list element for you"
  }
  harvest this.stored[index]
 }
 dig push plant tool(val) {
  this.stored.push(val)
 }
}

dig li plant new FunkyList([1, 2, 3])
holler(li.get(0)) # output = 1 #
holler(li.get(1)) # output = no list element for you #
holler(li.get(2)) # output = 3 #
li.push("list element please")
holler(li.get(3)) # output = no list element for you #
holler(li.get(4)) # error #

Good luck on your journey with Radish!


TODO

  1. Add syntax for class to class inheritance // DONE
  2. Add syntax to call inherited constructor // DONE
  3. Add more prototype class functions, such as array.pop() // DONE (sort of)
  4. Introduce getter functions, so that array.length can be called instead of array.length() // DONE
  5. Add tags for object/class properties, such as static, public/private/protected, etc // DONE
  6. Farm theme! // DONE
  7. Better debugging! Literally it's so bad // DONE
  8. Add manual exception throwing + try/catch syntax // DONE
  9. Make VSCode extension so that the code doesn't look so bland (also cool file symbol) // ALMOST DONE
  10. Add importing/exporting from other files!!! // DONE
  11. Package it so that users can install radish and run files without seeing all of the machinery // DONE
  12. async??

About

A custom language written in C#

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages