I don't like Python syntax, I think indenting is bad for developing. I like syntax similar to C++, Lua and Basic, replacing some simbols to words in Lua and Basic, per example, &&, || will be and, or.
And type enforcing will be fine, as you said.
I think we can add the pointer, but not for access to the memory, to access to any data of the source code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2008-08-29
I personally find indenting code blocks in general useful, but not Python's way of using indentation to end sections. C/C++'s use of { and }, for example, gives a clear indication of where a section block starts and ends, and it allows for freedom on how users indent code. I personally like to be able to do something like this on occasion, mainly for debugging:
if(item1 == 1)
{
printf("doing something to a bunch of variables\n");
a=1;
b=2;
printf("done playing with this set of variables\n");
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2008-08-29
Actually, this is how the code should have looked like (replace "-" with space or tab for every "----"):
if(item1 == 1)
{
----printf("doing something to a bunch of variables\n");
--------a=1;
--------b=2;
----printf("done playing with this set of variables\n");
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2008-08-29
Sorry for the disjointed posting. I was hoping to put my replies on one post if I let my brain catch up to what I'm typing
Regarding pointers, what do you mean exactly by "any data of the source code"? Some examples would help. In that same regard, I think we should provide a mechanism for users to "allocate" and "deallocate" memory that will not be handled by the garbage collector (at least as long as the instance of the interpreter is running). When my group was using Python for our server daemons one of the most annoying things we encountered was when the garbage collector kicked in at the top of the main loop (not sure what to call it exactly). Granted that it happened really fast, but it still left a spike on our profiling which we hope didn't happen at all.
Also, after putting some thought to what we will use to base our syntax on, I think we should target 1 as the primary starting point, similar to how Java syntax is pretty much based on C++ syntax. That way we have a point of reference for things we like and don't like, and for the new users to our language, they have a point of reference; for those using our language to learn programming they can branch out to other languages from us (of course we prefer that they never leave).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2008-08-29
Addition to feature list (there's probably a way to update a post that I haven't found yet):
-- OO sytax based on C++
-- Do automatic garbage collection
-- Possibly find different name to our scripting language to prevent confusion by people to BASIC programming language
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well I'm agree there, I thought you wanted to use indentation like Python.
if(item1 == 1 and item2 == 2 and item3 == 3 or item1, item2, item3 < 0){
print("Anything happened")
}
or item1, item2, item3 < 0
I think this part should be useful, and make code shortly and is easy to read.
I think a full function should look like this:
int #~ Type enforcing ~# main(){
int get(x); #~ return int value ~#
string get(z); #~ return string value ~#
print("You have entered '", z, "' after '", x, "'.");
if(x = 0 or x < 1){
print(x, " value is less than 1.");
}else{
print(x, " value is bigger than 1");
}
}
Do you like this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2008-08-29
I like the item1, item2, item3 < 0 syntax. I also like the function syntax.
While we're on the subject of syntax, I think to help us in the long run, we should use EBNF to describe our language's grammar. That way when we're ready to document our syntax (at alpha 1) we can copy/past most of these. I personally feel that using as many industry standard stuff as possible would be really great. I'll go ahead and start some grammar rule in the documentation which we can use as a starting reference for our discussion (again, trying to save time).
Keith
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, I will search the some C++ standars to include in the language (I have already STL and Boost)
I think would be a good idea implement a server module (a class which works like a server, for games, code updater, or for send news to the client) into the script.
Example:
function createServerOn(port){
BS_Server server = new BS_Server(port);
if not(server){
print("Error creating server on port: ", port)
}
server.Start();
while(server.isConnected()){
(string) data = server.receiveString(BS_SERVER_ANYCLIENT);
(string) client = server.getLastClient();
print(client, " sended ", data);
}
}
Do you like it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
[Regarding pointers, what do you mean exactly by "any data of the source code"? Some examples would help.]
For example, you want to access to a class called Position
class Position {
public:
Position(int _x, int _y, int _z) : x(_x), y(_y), z(_z) {}
// Continue
}
And you don't want to parse it because is so important and you don't want to let other developers to access some data of it.
So in the data we want to let them use, we put it into BS_POINTED_DATA_START / BS_POINTED_DATA_END macros, so to access it we use the pointer, per example to access to the variable int x:
Position * x;
I think it would be useful for private data into a class.
[I think we should provide a mechanism for users to "allocate" and "deallocate" memory that will not be handled by the garbage collector (at least as long as the instance of the interpreter is running).]
We can use "new" and items defined with new are ignored by the garbage collector, for example:
new int x = 10;
delete x;
[-- Possibly find different name to our scripting language to prevent confusion by people to BASIC programming language ] Forgot this line before.
Well, lets think a name for the language, you have any idea?
Lets think...
I don't know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Some ideas to get us going on what the core feature of BSPL will be:
-- Object-oriented
-- General purpose language
-- Run on any platform
-- Use syntax similar to Python, Basic, and Lua
I don't like Python syntax, I think indenting is bad for developing. I like syntax similar to C++, Lua and Basic, replacing some simbols to words in Lua and Basic, per example, &&, || will be and, or.
And type enforcing will be fine, as you said.
I think we can add the pointer, but not for access to the memory, to access to any data of the source code.
I personally find indenting code blocks in general useful, but not Python's way of using indentation to end sections. C/C++'s use of { and }, for example, gives a clear indication of where a section block starts and ends, and it allows for freedom on how users indent code. I personally like to be able to do something like this on occasion, mainly for debugging:
if(item1 == 1)
{
printf("doing something to a bunch of variables\n");
a=1;
b=2;
printf("done playing with this set of variables\n");
Actually, this is how the code should have looked like (replace "-" with space or tab for every "----"):
if(item1 == 1)
{
----printf("doing something to a bunch of variables\n");
--------a=1;
--------b=2;
----printf("done playing with this set of variables\n");
}
Sorry for the disjointed posting. I was hoping to put my replies on one post if I let my brain catch up to what I'm typing
Regarding pointers, what do you mean exactly by "any data of the source code"? Some examples would help. In that same regard, I think we should provide a mechanism for users to "allocate" and "deallocate" memory that will not be handled by the garbage collector (at least as long as the instance of the interpreter is running). When my group was using Python for our server daemons one of the most annoying things we encountered was when the garbage collector kicked in at the top of the main loop (not sure what to call it exactly). Granted that it happened really fast, but it still left a spike on our profiling which we hope didn't happen at all.
Also, after putting some thought to what we will use to base our syntax on, I think we should target 1 as the primary starting point, similar to how Java syntax is pretty much based on C++ syntax. That way we have a point of reference for things we like and don't like, and for the new users to our language, they have a point of reference; for those using our language to learn programming they can branch out to other languages from us (of course we prefer that they never leave).
Addition to feature list (there's probably a way to update a post that I haven't found yet):
-- OO sytax based on C++
-- Do automatic garbage collection
-- Possibly find different name to our scripting language to prevent confusion by people to BASIC programming language
Well I'm agree there, I thought you wanted to use indentation like Python.
if(item1 == 1 and item2 == 2 and item3 == 3 or item1, item2, item3 < 0){
print("Anything happened")
}
or item1, item2, item3 < 0
I think this part should be useful, and make code shortly and is easy to read.
I think a full function should look like this:
int #~ Type enforcing ~# main(){
int get(x); #~ return int value ~#
string get(z); #~ return string value ~#
print("You have entered '", z, "' after '", x, "'.");
if(x = 0 or x < 1){
print(x, " value is less than 1.");
}else{
print(x, " value is bigger than 1");
}
}
Do you like this?
I like the item1, item2, item3 < 0 syntax. I also like the function syntax.
While we're on the subject of syntax, I think to help us in the long run, we should use EBNF to describe our language's grammar. That way when we're ready to document our syntax (at alpha 1) we can copy/past most of these. I personally feel that using as many industry standard stuff as possible would be really great. I'll go ahead and start some grammar rule in the documentation which we can use as a starting reference for our discussion (again, trying to save time).
Keith
Ok, I will search the some C++ standars to include in the language (I have already STL and Boost)
I think would be a good idea implement a server module (a class which works like a server, for games, code updater, or for send news to the client) into the script.
Example:
function createServerOn(port){
BS_Server server = new BS_Server(port);
if not(server){
print("Error creating server on port: ", port)
}
server.Start();
while(server.isConnected()){
(string) data = server.receiveString(BS_SERVER_ANYCLIENT);
(string) client = server.getLastClient();
print(client, " sended ", data);
}
}
Do you like it?
[Regarding pointers, what do you mean exactly by "any data of the source code"? Some examples would help.]
For example, you want to access to a class called Position
class Position {
public:
Position(int _x, int _y, int _z) : x(_x), y(_y), z(_z) {}
// Continue
}
And you don't want to parse it because is so important and you don't want to let other developers to access some data of it.
So in the data we want to let them use, we put it into BS_POINTED_DATA_START / BS_POINTED_DATA_END macros, so to access it we use the pointer, per example to access to the variable int x:
Position * x;
I think it would be useful for private data into a class.
[I think we should provide a mechanism for users to "allocate" and "deallocate" memory that will not be handled by the garbage collector (at least as long as the instance of the interpreter is running).]
We can use "new" and items defined with new are ignored by the garbage collector, for example:
new int x = 10;
delete x;
[-- Possibly find different name to our scripting language to prevent confusion by people to BASIC programming language ] Forgot this line before.
Well, lets think a name for the language, you have any idea?
Lets think...
I don't know.