Since we're creating a new language, who says we can't create an entirely new way of thinking about concepts. Kittahs obviously do this already.

I propose that data types be called “things”.

Define a thing using a single command:

I HAS A [thing-name] IZ [type of thing] (I TAKE FROM [source])

Unset a thing using a similar command:

I HAD A [thing-name]

The I TAKE FROM paramater is optional depending on the type of thing.

Here's some examples of things we could have:

BUKKIT (default) - a variable (string, integer, whatever - do cats REALLY know the difference? the point being - a bucket can hold pretty much anything anything)

FILE - a file contruct - specify file location as [source]

GRAFIK - an image holder for manipulation

Finally, a construct to issue thing-specific commands:

WIT [thing name] I [command] (INTO [destination])

For example, to read a line from a file opened as “file_holder”

WIT file_holder I READED A LINEZ INTO text

In my example I'm putting thing-names in lowercase for legibility and I think it should just be a general rule anyway) Using those things above, we could do something like this:

BTW This code asks for some text, loads cat.jpg, adds the text to the image, and saves the file.
HAI
  BTW Defining Bukkit thing
  I HAS A text

  BTW Get text from user
  GIMMAH text

  BTW load the file and transfer it to a GRAFIK thing
  I HAS A file_holder IZ FILE I TAKE FROM "cat.jpg"
  I HAS A image_holder IZ GRAFIK I TAKE FROM file_holder

  BTW Place text on image
  WIT image_holder I PUTS WHITE TEXT text

  BTW Save the image to the file holder
  WIT image_holder I JPEGS INTO file_holder
  WIT file_holder I SAVES

  LOL "I DIDS IT!"
KTHXBYE

It's at least the start of a rather silly idea…

orange haired boy, 2007/05/30 18:04

I think the WITH … I … would be a nice way to call functions in objects. But I think the function names should be one word only, so it would be

WITH image_holder I JPGEGS_INTO file_holder

I also like the idea of different types of variables, but I don't think we need to specify it. Java for example loves specifying things hundreds of times, and it makes no sense:

MyClass something = new MyClass();

It is obvious that something is a MyClass and whatever MyClass inherits or implements. This means that we could just have

I HAS A file_holder ITZA FILE WITH "cats.jpg"

Marius, 2007/05/30 18:18

contributions/item-types.txt · Last modified: 2007/05/30 19:44 by orangehairedboy
Recent changes RSS feed Creative Commons License Donate Driven by DokuWiki