Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / JemSCRIPT

Author
Message
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 26th May 2007 01:27 Edited at: 26th May 2007 02:59
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:


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!

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 26th May 2007 13:35
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. And as I said, if you need to build a DLL, you are most certainly welcome to use my Dev-C++ template for it. (Strip the DBP command section though, you won't need it)

Keep up the amazing work!

Cheers,

-db

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 26th May 2007 13:42
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!

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 26th May 2007 15:21
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

Chris Franklin_
17
Years of Service
User Offline
Joined: 21st Dec 2006
Location: Home
Posted: 26th May 2007 22:34
Very cool man, keep it up

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 26th May 2007 22:57
Thank you.

I'm just installing the DX SDK. Very soon (with some help from Kentaree ) you will be able to call DBP commands from the script, heh.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th May 2007 00:50
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?

zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 27th May 2007 07:20
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.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th May 2007 13:47
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:



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 Something that I think is a bad choise - sorry mate!

Any other requests, comments, critics?

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 27th May 2007 14:11
I like the C++ way. But too be honest, I REALLY prefer to be able to give types to variables so I know what they are. Is it possible that you can keep "var" as an "any" type, and add in "float", "int", "char", etc?

Cheers,

-db

The Nerd
19
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 27th May 2007 14:15
Looks promising Zotoaster Keep up the good work! And good luck with it.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th May 2007 14:17
Thanks Nerd.

Alright DB User, I can give it another shot It just got really annoying most of the time, but hey, I'm sure I can work around it a little better this time.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 27th May 2007 14:31
ok.
Awsome to hear all this, keep up the good work. (Glad it's finally a WIP )

Cheers,

-db

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 2nd Jun 2007 03:17
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 They were just annoying, and I think went a bit too C-ish.

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:


Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 18th Jun 2007 02:38 Edited at: 18th Jun 2007 02:41
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:


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.

MartinS
18
Years of Service
User Offline
Joined: 15th Dec 2005
Location: Rochester, NY
Posted: 18th Jun 2007 12:22
Hands down, this thing is sweet! The database functionality is a real improvement, and it kills XML. Quick question: Rather than doing
, is it possible to do
?

Keep up the good work!
G2L

MartinS
18
Years of Service
User Offline
Joined: 15th Dec 2005
Location: Rochester, NY
Posted: 18th Jun 2007 12:23
Oh, and can you do block comments? e.g.


Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 18th Jun 2007 17:23 Edited at: 18th Jun 2007 18:11
G2L,

You can set out the syntax however you like Also, it should be ==, not =

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:


Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 19th Jun 2007 02:43 Edited at: 19th Jun 2007 03:12
*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:


Xenocythe
18
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 19th Jun 2007 04:23
Going awesome man. Looks really nice. Keep up the great work

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 22nd Jun 2007 23:50
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:


Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 23rd Jun 2007 16:21
Bump:

Table's semi-working. Still have to make instancing, then we have OOP!!





MartinS
18
Years of Service
User Offline
Joined: 15th Dec 2005
Location: Rochester, NY
Posted: 23rd Jun 2007 16:29
Looking good. Do you have an expected release date?

G2L

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 23rd Jun 2007 16:36
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

Blue Rogue
16
Years of Service
User Offline
Joined: 6th Jul 2007
Location:
Posted: 10th Jul 2007 04:46
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.
Blue Rogue
16
Years of Service
User Offline
Joined: 6th Jul 2007
Location:
Posted: 10th Jul 2007 04:54
scrub that post.. just found a site. but thanks anyway.

Login to post a reply

Server time is: 2024-04-19 18:54:04
Your offset time is: 2024-04-19 18:54:04