For me it's personal style and in my opinion, documenting it is just cluttering the code file and since I have no experience working with other developers or documenting code, I won't be sure that the documentation would mean anything. Plus, it becomes a pain in the ass when your making loads of public/private methods and document each one, however I do comment on every part of the code...bbguimaraes wrote:I meant developers working with you on the project, I should've been more explicit. Even if you're working on your own, I think it's better to have it documented. It makes your life easier, you can get back to your project a few months (sometimes event weeks) and still know what your code does and, should any developer join your team later, you have no extra work to do.tappatekie wrote:I haven't decided yet whether I open source it, however there is advantages, the programming language internal systems cannot be touched by other people since its a little security issue (unless I make it a seperate library..)bbguimaraes wrote:On the code organization topic: reading source code should be the last resource when trying to understand how some part of the application works. You (the developer) should supply documentation to guide users (developers using your code, not the end user).
But I guess it's all personal style.
Scripting Language development
Moderator: Coders of Rage
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: Development video on youtube
- bbguimaraes
- Chaos Rift Junior
- Posts: 294
- Joined: Wed Apr 11, 2012 4:34 pm
- Programming Language of Choice: c++
- Location: Brazil
- Contact:
Re: Development video on youtube
I agree on the code comments, you should just comment what really needs comments. I refer to documentation outside the code. I think one example will clarify things:
http://www.boost.org/doc/libs/1_49_0/do ... hrono.html
Of course it doesn't need to be that long and detailed. Sometimes a single diagram (UML or not).
http://www.boost.org/doc/libs/1_49_0/do ... hrono.html
Of course it doesn't need to be that long and detailed. Sometimes a single diagram (UML or not).
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: Development video on youtube
Oh... in that case, If I were to make a documentation, itl be something like this (basic...)bbguimaraes wrote:I agree on the code comments, you should just comment what really needs comments. I refer to documentation outside the code. I think one example will clarify things:
http://www.boost.org/doc/libs/1_49_0/do ... hrono.html
Of course it doesn't need to be that long and detailed. Sometimes a single diagram (UML or not).
Plywood {
Run(Stream stream); (Executes plywood source code given from the stream)
}
etc...
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: Development video on youtube
Okay enough teasers about the actual source code for plywood, now lets see some plywood code being executed!
And yes, that is notepad++... Some of the text has been blocked out since, its a secret :D.
This specific code expresses the "Dynamic Object Type Association (DOTA)" in action. the "printl" (print line) is a console function which.... prints a line.. Here is some syntax stuff
[def] = [6]
def = defines value i of value 6
= [&] " World"
& = (basically, adds 2 strings together)
And yes, that is notepad++... Some of the text has been blocked out since, its a secret :D.
This specific code expresses the "Dynamic Object Type Association (DOTA)" in action. the "printl" (print line) is a console function which.... prints a line.. Here is some syntax stuff
[def] = [6]
def = defines value i of value 6
= [&] " World"
& = (basically, adds 2 strings together)
- VolsporTV
- Chaos Rift Newbie
- Posts: 40
- Joined: Wed Apr 11, 2012 12:18 pm
- Current Project: The Void
- Favorite Gaming Platforms: PC, NES, Dreamcast
- Programming Language of Choice: C/++ and ByondScript
- Location: Enid, OK
Re: Development video on youtube
tappatekie wrote:Okay enough teasers about the actual source code for plywood, now lets see some plywood code being executed!
And yes, that is notepad++... Some of the text has been blocked out since, its a secret :D.
This specific code expresses the "Dynamic Object Type Association (DOTA)" in action. the "printl" (print line) is a console function which.... prints a line.. Here is some syntax stuff
[def] = [6]
def = defines value i of value 6
= [&] " World"
& = (basically, adds 2 strings together)
That's looking pretty good!
You have a lot of talent mate.
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: Development video on youtube
Cheers :P Looking forward to making the video :PVolsporTV wrote: That's looking pretty good!
You have a lot of talent mate.
- bbguimaraes
- Chaos Rift Junior
- Posts: 294
- Joined: Wed Apr 11, 2012 4:34 pm
- Programming Language of Choice: c++
- Location: Brazil
- Contact:
Re: Development video on youtube
Okay, after writing a long explanation, I realized how I've been filling your post with something almost unrelated to it. So, I will leave my relevant-to-the-post comment and add a spoiler box on the bottom with my text:
The project seems really nice so far. I once implemented a parser for a language in a Compilers class (some kind of pseudocode language we used on the Algorithms class). It didn't generate code for it, just couted a pseudo-assembly code, but it was a lot of fun.
The project seems really nice so far. I once implemented a parser for a language in a Compilers class (some kind of pseudocode language we used on the Algorithms class). It didn't generate code for it, just couted a pseudo-assembly code, but it was a lot of fun.
Click here to see the hidden message (It might contain spoilers)
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: Development video on youtube
Hmm, atm the code is nothing like that :L Its just a single definition (private class) array, definition holds the name, value, numeric (boolean flag), and array list. Although I plan to make it more "friendlier" so it's easier to add variables directly to the interpreter from a third party application. I also intend to do the same with methods.
However, RunState provides the current status of the interpretation, e.g stream position, current line etc... which enables functions like goLine(line) to exist.
But actually, your method of the SymbolTable class would be pretty useful instead of that (although it'l need a few re-writes of code...). Or I just have SymbolTable as a wrapper class to hook up with the internals of the interpreter.
The one thing that is completely "hackable?" in the interpreter is the function "allow/deny" function to basically stop the invoke of a function when it is about to be invoked.
However, RunState provides the current status of the interpretation, e.g stream position, current line etc... which enables functions like goLine(line) to exist.
But actually, your method of the SymbolTable class would be pretty useful instead of that (although it'l need a few re-writes of code...). Or I just have SymbolTable as a wrapper class to hook up with the internals of the interpreter.
The one thing that is completely "hackable?" in the interpreter is the function "allow/deny" function to basically stop the invoke of a function when it is about to be invoked.
- THe Floating Brain
- Chaos Rift Junior
- Posts: 284
- Joined: Tue Dec 28, 2010 7:22 pm
- Current Project: RTS possible Third Person shooter engine.
- Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
- Programming Language of Choice: C/C++, Python 3, C#
- Location: U.S
Re: Development video on youtube
I have an game engine, in it I am planning to make it so any scripting language you want can be implemented, may I ask
A:
Will you be able to set instances of C# classes as script globals and use them (call methods set public variables, use refs?) in the script?
B:
If so, may I see a sample as to how you would do that from a C# perspective?
A:
Will you be able to set instances of C# classes as script globals and use them (call methods set public variables, use refs?) in the script?
B:
If so, may I see a sample as to how you would do that from a C# perspective?
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: Development video on youtube
The interpreter would need some fine tuning towards managing .net objects but the code would be (c#)THe Floating Brain wrote:I have an game engine, in it I am planning to make it so any scripting language you want can be implemented, may I ask
A:
Will you be able to set instances of C# classes as script globals and use them (call methods set public variables, use refs?) in the script?
B:
If so, may I see a sample as to how you would do that from a C# perspective?
Code: Select all
Plywood ply = new Plywood();
//Add your object
ply.AddDefinition("myCsObject", yourCsObject, ObjectType.InstanceClrManage);
//Add your assembly (this would give the clr_ methods access to methods and classes in that assembly)
ply.ClrManager.AddAssembly("myDll.dll")
//Run the code
ply.Run(yourSourceStream, false, yourRunState);
// ^^ it's false because we don't want to clear the definition we just defined....
The one thing I need to tell you now before you read below, the language was not originally designed for using .net objects, and by invoking there methods, would be using reflection.
ObjectType.InstanceClrManage tells the method that we want the definition setup and handled as an "object" and not a plywood definition.
Now I am planning on having a method like "clr_invoke", "clr_create" etc... to manage .net stuff so in the script, you can create and control .net instances etc... and even maybe run c# code from plywood script itself.... (but thats a big IF)
The plywood source would be (remember myCsObject)
Code: Select all
//Invoke the local method in myCsObject Print and pass arguments "Hello World" to it
clr_invoke(myCsObject, "Print", "Hello World")
//Here is to invoke a static class method
clr_invoke("Console", "WriteLine", "Hello World")
Also, the one thing I will point out is, your code would probably get more messy in plywood in terms of properies, e.g (passing a object property to a method)
Code: Select all
//Prints the return value of "Console.Out"'s ToString method to the console.
clr_invoke("Console", "WriteLine", clr_invoke(clr_getProperty("Console", "Out"), "ToString"))
- THe Floating Brain
- Chaos Rift Junior
- Posts: 284
- Joined: Tue Dec 28, 2010 7:22 pm
- Current Project: RTS possible Third Person shooter engine.
- Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
- Programming Language of Choice: C/C++, Python 3, C#
- Location: U.S
Re: Development video on youtube
Thank you!
Iv been trying to figure out how to design a method to send objects to scripts that is abstract
enough to cover the majority of languages, this really helped!
Iv been trying to figure out how to design a method to send objects to scripts that is abstract
enough to cover the majority of languages, this really helped!
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: Development video on youtube
No problem mate
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: Development video on youtube
"Programming Language Development Episode 1" starts being filmed this Sunday! (22/04/12) so expect a video next week!!
Also, does anyone recommend any software for me to use to film&edit it? I have got a microphone and Im thinking of using QuickCam.
Even if that software is pricey... (I want to buy it tomorrow if possible...)
Also, does anyone recommend any software for me to use to film&edit it? I have got a microphone and Im thinking of using QuickCam.
Even if that software is pricey... (I want to buy it tomorrow if possible...)
- VolsporTV
- Chaos Rift Newbie
- Posts: 40
- Joined: Wed Apr 11, 2012 12:18 pm
- Current Project: The Void
- Favorite Gaming Platforms: PC, NES, Dreamcast
- Programming Language of Choice: C/++ and ByondScript
- Location: Enid, OK
Re: Development video on youtube
I use this to edit my films.tappatekie wrote:mmend any software for me to use to film&edit it? I have got a microphone and Im thinking of using QuickCam.
Even if that software is pricey... (I want to buy it tomorrow if possible...)
http://www.newegg.com/Product/Product.a ... 6832106270
As for filming are you doing it on the computer or a film of yourself like the ES team does?
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: Development video on youtube
Just a screen video with me narrating, I was thinking of me "webcamming?" myself introducing the video....VolsporTV wrote: As for filming are you doing it on the computer or a film of yourself like the ES team does?
As for the software you said, it looks pretty good, il get it :D