haasn / -g-pl

/g/ programming language
13 stars 2 forks source link

Allow global execution or not? #11

Closed haasn closed 13 years ago

haasn commented 13 years ago

Should we allow top-level expressions other than >implying or should we restrict it to those? The practical effect of this is, do we force everybody to create an OP function, or do we allow direct code execution?

The pros and cons of both:

Allow only top level implications, force OP functions:

Pros:

yate commented 13 years ago

i'm for top level, for the pro listed (and easier to parse maybe?)

graydude commented 13 years ago

This is quite a big thing. The real issue here is how the language is going to work; is it going to be compiled or interpreted?

haasn commented 13 years ago

My implementation is definitely going to be interpreted, due to the runtime variable name resolution rules I've described. Of course, it could be compiled together with a very slow runtime (where every variable reference would perform a runtime call to resolve it)

graydude commented 13 years ago

If we're going to go interpreted, I think we should allow global execution.

haasn commented 13 years ago

It's probably the best solution. To solve the “functions need to be defined before they can be used” thing, a user could throw all of his functions into separate files and include them all at the top of the main file.

(We'd need a nice meme-based syntax for inclusion as well)

graydude commented 13 years ago

How about

install functions.gs

We could have header files called gentoo!

I think we should also take a look at the name of functions. Maybe we can call them Threads or something. But I'll make another issue out of this some time.

haasn commented 13 years ago

install sounds good. “install gentoo” should be reserved for something silly though, I don't know what yet.

I was thinking threads should be reserved for actual threads, eg. concurrency features that we may wish to implement later on.

Y'know, like /thread could mean “terminate the current thread” and all that. Maybe something else for functions, like “posts”?

graydude commented 13 years ago

/thread sounds cool. We could also use an unboxing thread for including, but install sounds better to me.

If we use posts for it, you know we should have a captcha for creating a new function :)

haasn commented 13 years ago

Nah, but >captcha should be a built-in function which presents a captcha to the user (as popup if graphical environment is found, otherwise as ASCII art), and returns a bool depending on whether or not the user entered it correctly

haasn commented 13 years ago

I'm closing this issue since it looks like we'll be keeping global execution.