WIP / JemSCRIPT |
| Author | Message | ||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Hello everyone and I am finally back again with the new JemScript. I apologise for posting all those rediculous intrpreted versions, but hey, I learned alot from it. Now I am back with a much better (but not yet finished) version of Jem. Actually, it is not linked in anyway with DBPro just now, because it's fully written in C++, but that doesn't matter, because I intend to make it a dll, so, heh. Features: - C-Style syntax - Typed variables/functions - Compiles to bytecode - Virtual machine is provided to run the bytecode (pretty pointless if it wasnt) That's about it for features. I guess I could add that it's alot faster than my last one because it's compiled, not interpreted. This is currently what it looks like now: + Code Snippet Ofcourse, I soon intend to add classes. Ever since I got into C++ I haven't been able to program without OO So yeah, post your comments and critiques, and we'll see how it goes! ![]() |
||
| Back to top |
|||
|
Aaron Miller
User ![]() Joined: Sat Feb 25th 2006 Location: Behind the trusty dumpster. |
Zotoaster you are some kind of a genius! I can't wrap my head across building a parser for something like THAT. Quite simply amazing. Keep up the amazing work! Cheers, -db ![]() |
||
| Back to top |
|||
|
Benjamin
User Joined: Sun Nov 24th 2002 Location: France |
Sounds interesting, I'm also working on a scripting language. I'm quite proud of my tokenizer that can tokenize the FPSC game source code (27K lines) in 52ms, but that's just bragging. I'm not sure of the point of making it too C-like, after all there are other scripting languages around that are. I think it's possible to simplify the syntax while still retaining the power and flexibility. Anyway, looks like you've done well so far. Congratulations! |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Thanks for the comments The reason I decided to have such C syntax is because that the features I intend to add (pointers and classes mostly) arent that often used in BASIC, so I figure that more people would be happy with it like it is. Once I have finished the preprocessor, I will make a set of defines that will give it a simpler syntax ![]() |
||
| Back to top |
|||
|
Chris Franklin_
User Joined: Thu Dec 21st 2006 Location: Home |
|
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Thank you. I'm just installing the DX SDK. Very soon (with some help from Kentaree ![]() |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
I think you are right about the syntax thing. I am strongly considering doing something about that. Lol, it's really getting a neucance, well, only having types functions and variables. You guys dont have a problem with just function foo() and var bar[] right? ![]() |
||
| Back to top |
|||
|
zenassem
User ![]() Joined: Mon Mar 10th 2003 Location: Long Island, NY |
I am really looking foward to this Zotoaster. As you can see with regard to my scripting inquiries and Python interest. I think that you could follow some of Pythons syntax. I can provide some examples from the book I have. It's a lot like c++ - the annoying factor. ![]() |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Zen, I think it's best that since it has alot of features like C++, to make it similar. Makes the majority of people comfortable with it. But luckily, I have a very flexible parser. If you wanted, you could write it like this: + Code Snippet Not much different really, but it seems people dont really like {}s Am I right in thinking that Python has forced indentation with no {}s? That would make it totally stack-less as far as I can see, something that's so needy in my scripting that it would mean I'd have to start from the begining again and completely redesign the bytecode and virtual machine Any other requests, comments, critics? ![]() |
||
| Back to top |
|||
|
Aaron Miller
User ![]() Joined: Sat Feb 25th 2006 Location: Behind the trusty dumpster. |
I like the C++ way. Cheers, -db |
||
| Back to top |
|||
|
The Nerd
User Joined: Sat Jun 5th 2004 Location: Denmark |
Looks promising Zotoaster |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Thanks Nerd. Alright DB User, I can give it another shot ![]() |
||
| Back to top |
|||
|
Aaron Miller
User ![]() Joined: Sat Feb 25th 2006 Location: Behind the trusty dumpster. |
ok. Awsome to hear all this, keep up the good work. Cheers, -db |
||
| Back to top |
|||
|
Google Ad
AdBot Joined: Aug 26th 2002 Location: Everywhere |
|||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Just some news. Since the restart I have already improved on it quite a lot. The actual compilation stage isn't finished, but it's going well. As far as the virtual machine is concerned, it can now handle parameters (only be value so far), and return values, so using functions in equations works quite the thing. Really annoying having to type in every bytecode seperatally though, like 3 lines for a single-element variable (not an array in other words). Hopefully I'll have the compiler itself working enough by tomorrow so proper scripts can be run. Also virtual memory management has been improved, and it's not as low-level feeling (i.e. every piece of data in memory having to be an int), so that should make things alot easier to work with (for me anyway, heh). As DB User recommended, I still keep typed variables, but not functions I have also been able to clean up the actual code quite alot, seems to happen when I restart a project, but yeah, now it should probably run faster and be more efficient. Here is a boring example just for the heck of it: + Code Snippet ![]() |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
During yesterday and today I've been working to make a simpler, less buggy, scripting language, but added some features. It has no types, and doesnt support arrays (they were a bitch to work), but it does work more stably, and I have decided to add tables, like Lua, but with [] instead of {}. I've also make working loops. The reason I did this was to see if the features I wanted to add at first were even that useful. I only want functionality in my scripts, and even though flexibility is good, it is pointless unless you are using it to write anything big (ie the game engine). I only want to for things like AI, etc. So, no need for arrays, types variables, etc. Here is a working, very stable (and fast) example, of using functions, parameters, variables and tables: + Code Snippet Obviously, that wont be very good in a game, but using the features here, it can be. I think this will do for JemSCRIPT to be perfectly honest. All I have to do is add a few operands (like ++), get the ability to read table values directly from C++, make it call DBPro commands, then just make it a dll. Tada! Problem is, I don't have a clue how to do the last two.. I'm sure I'll figure it out though P.S. Forgot to mention that just like the last one, this one compiles to bytecode too. ![]() |
||
| Back to top |
|||
|
MartinS
User ![]() Joined: Thu Dec 15th 2005 Location: Rochester, NY |
Hands down, this thing is sweet! Keep up the good work! G2L |
||
| Back to top |
|||
|
MartinS
User ![]() Joined: Thu Dec 15th 2005 Location: Rochester, NY |
|
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
G2L, You can set out the syntax however you like As for block comments, I forgot to add them, but I might aswell just do that now, heh. Thanks for the comments [edit] Just got rid of the annoying "getTable()" function thing. Now you can just do something like: + Code Snippet ![]() |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
*Bump* I decided to re-add the getTable() function (but obviously still keep the other method), because the fact that it used strings was pretty useful. It means you can loop through a table, sorta like an array. So you may have guessed that already I have made some typecasting. There are 3 typecasting functions, string(), int() and float(). I'm sure you know what each does. Each one takes all types apart from it's own. Here's an example of looping through a table and printing the data: + Code Snippet ![]() |
||
| Back to top |
|||
|
Xenocythe
User Joined: Thu May 26th 2005 Location: You Essay. |
Going awesome man. Looks really nice. Keep up the great work |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Thanks Xeno. Small update: Again, I restarted, as usual, for better table functionality. Even though I havent actually started making the tables yet, I have done something that I haven't in all my last implementations... an "else" statement!!! Demo: + Code Snippet ![]() |
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
|
||
| Back to top |
|||
|
MartinS
User ![]() Joined: Thu Dec 15th 2005 Location: Rochester, NY |
|
||
| Back to top |
|||
|
Zotoaster
User ![]() Joined: Mon Dec 20th 2004 Location: Scotland |
Well, once I get tables finished, and when I get it to call DBP commands, and then figure out how to make it a DLL, then I'll release it ![]() |
||
| Back to top |
|||
|
Blue Rogue
User Joined: Fri Jul 6th 2007 Location: Cyberspace |
hey good work. Im currently writing a scripting engine thats really more of an interpreter. But I would love to take it to the next level as you have done here. Do you have any good online sources you may be willing to share so I can investigate going about creating something similar to ByteCode. |
||
| Back to top |
|||
|
Blue Rogue
User Joined: Fri Jul 6th 2007 Location: Cyberspace |
scrub that post.. just found a site. but thanks anyway. |
||
| Back to top |
|||
Sorry, but it has been so long since anyone replied to this Thread that it has been automatically locked.
You may read it but not reply.
You may read it but not reply.
Forum Search
Enter a word or phrase to search our Forum for:
|
|











