adityarajpt / HelloWorldInator

Repository based on a reddit comment
13 stars 6 forks source link

Add petpet #25

Closed TooManyLimits closed 1 year ago

TooManyLimits commented 1 year ago

Made a language recently, friend linked this repo and I thought "why not"

adityarajpt commented 1 year ago

This isn't returning a callable?

Main aim is to have a function or thing that returns callable/function printing hello world

adityarajpt commented 1 year ago

Also please can you also add a link to the compiler/interpreter of your language, so we can compile and see the program in action

TooManyLimits commented 1 year ago

The language is a bit interesting in that the entire file is itself a function which returns the last expression in the file. The last (and only) expression in the file is an anonymous function that prints Hello World - so the file itself is a function that returns a function that prints Hello World. As for the language, it’s located at my repo: https://github.com/Moonlight-Maya/PetPet There isn’t any documentation at all at the moment, unfortunately, but you can look at the Test file for an example of how a script could be run. If you choose not to include this language that’s alright with me; I just submitted this on a “why not” and I understand it’s a lot of effort to verify this.

TooManyLimits commented 1 year ago

And, as of just now, I've made a commit which adds a function for testing, showcasing this exact example. https://github.com/Moonlight-Maya/PetPet/blob/460ced5fa56ec49cb79a3ab95eb9b4a157afd155/src/test/java/Test.java#L11

TooManyLimits commented 1 year ago

Another update, it's now less meta, instead it defines a global function within the script environment which returns a callable to print hello world