JSE - Jay's Scripting Engine

Started by Pakz, May 09, 2021, 00:06:38

Previous topic - Next topic

Pakz

https://agameaweek.com/JSE/

Over at socoder.net Jayenkai in a couple of months has created a basic like language. It is still being worked on but I'm rather impressed as there are not that many browser/tablet based options for game programming that I could get along with.

It has a built in sprite/sound/music editor and docs with copy and paste code to test. There's a starfield!

It has this Blitz Basic like look to it.

zelda64bit

Will there be an offline version, for download ?, from the looks of it ... maybe it is being built with javascript, it could be slow.

Pakz

#2
I have no idea what versions are coming. I think the code is transpiled/translated to javascript and runs at javascript speed.

edit: I asked. It is interpreted!

zelda64bit

Quote from: Pakz on May 09, 2021, 15:55:28
I have no idea what versions are coming. I think the code is transpiled/translated to javascript and runs at javascript speed.

edit: I asked. It is interpreted!

Ask him if there will be a portable version and tell him to post the progress here on the forum.

Pakz

I wil ask. In the meanwhile here is the thread on socoder.net. There's regular updates there. I think he might be to busy to do updates on more sites.


https://socoder.net/?Topic=8135

zelda64bit


Jayenkai

(Apologies for necro-posting, but I'd rather do this, than to hijack an unrelated thread with JSE stuff)

Over on the "Which languages to make a simple 2D web game" thread, angros47 said...
QuoteI tried your JSE, and I found out a weird thing: on Firefox, it doesn't work from private browsing, although it works in regular mode. On Chrome (at least on my phone) it seems to work in both modes
JSE works by saving your code inside the "LocalStorage" of your browser, which it then parses and interprets in a rather oldskool fashion.
It does all of this 100% inside the browser, the server is currently* only there to serve the initial webpages to you.  There's no back and forth.  There is a separate "Upload to server" button, but that's only if you want to share your code with a URL.. Otherwise nothing gets back'n'forth'ed to the server..
Before the parsing, though, comes that LocalStorage.

* I'm intending to add an online cloud service, but I'm currently battling the age-old "what if you code on one computer, tweak the code in another computer but it doesn't upload, then use the first computer again and that version uploads to the cloud....  The cloud version is now the older version, but with a newer timestamp, and if you switch to computer 2, you'll likely lose all your work as it downloads the more recent version, which is older...." cloud based issue.  I don't want to enable online storage unless I've found a workaround for that.. Likely in the form of a popup requester or two.. or three.. or seventy.

Anyhoo...
If you switch to Private Browsing mode in your browser, nothing is saved to LocalStorage, because it's private, and you don't want things to be saved anywhere.
This is why, in Firefox, the engine no longer works properly.  There's nothing to "grasp" from LocalStorage, as your code is quite obviously not being saved, so the parser can't work with it.
This is "correct"

What Chrome does, is that it saves things, even in Private mode.
.. And I don't think that's right.
Do you?
Hmmm...
You might want to look into using Firefox more frequently if you want true private browsing.

As for previous comments.
1. OMG, I started this project so long ago.  Sorry for not replying earlier!
2. There "might" be a compiling-to-true-Javascript version at some point, but that'll probably require server-side compiling, because of potential security risks.  Browsers-be-browsers!
3. As far as "Offline" coding goes, the site and all functionality "should" stay resident in your browser's cache, unless you're in private mode, obv...  A few months ago, we moved house and I was pretty much without internet for a day and a half, but was still able to code well enough in JSE.  Just be sure you don't hit the refresh button!!

I could "probably" create a download/upload version that you can stick onto your own server, to access it from there, but as far as running it from your hard drive, there's "local host" based security things that make it not really all that viable.
There is a mini-player, which you can download.  The "Download HTML5 Project" menu item will download a zip containing a player version with your current code in it.  You can then upload that to itch.io, or your own server, or whatever.
"Load, Next List"

angros47

I imagined the reason was something like that, and I wasn't too much surprised to see it didn't work in Firefox private mode.... I was just surprised it worked in Chrome's one.

By the way, I sent you a mail some days ago, I am not sure if you received it (mentioning a possible solution for fonts)

Jayenkai

Aye, and I lengthily waffled in a reply, too!
..
Did you get the reply?
Maybe I should copy&paste my reply, here, if not.  It is a lengthy rambling waffle, though.
"Load, Next List"

angros47

Weirdly, my mail client didn't download it, I got it now

Baggey

Quote from: Pakz on May 09, 2021, 15:55:28I have no idea what versions are coming. I think the code is transpiled/translated to javascript and runs at javascript speed.

edit: I asked. It is interpreted!

From my little experience anything interpreted is going to be slow! :-X

It will need to be offline as well stand alone.

Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on Acer 24" . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Amiga mini, ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!

Jayenkai

Yeah, it's slow.  And nested loops are currently my biggest issue.
I REALLY need to speed those up a bit, they're very slow.

If you want a game engine, it's probably not the thing you want. And it wasn't really coded for that purpose, either.

Over the past few years I've been finding it harder to show quick code examples to people.  Either they don't own a version of Blitz, or they're using another language, or whatever.  The concept of "Here's a quick example", followed by a 72 step guide as to how to run the example, was starting to irritate me.
That's why I wrote JSE.  It's a "compatible-to-a-point" BASIC language.  Blitz, SmileBASIC, even a few select pickings from oldskool systems.

Mode 0,"C64"
10 FOR M=0 TO 7:WRITE CHR$ (205.5+RND (1)):NEXT:FLIP:GOTO 10


It's definitely not feature-complete, far far far from it, and there's TONS of stuff it can't do, but if you need to show a brief example of a coding concept or something, it's really great for that.

Once I got the basics (!) up and running, I then started optimising it.  It's still slow as molasses when you want it to do certain things, so you definitely wouldn't want be writing a AAA game with it. (And browser cache refreshes will erase the lot...  ..  Use the "Export Projects" button frequently!!!)

But like I said, that's not really the point of it.
The point of it is to go "here's roughly how you do this maths/algorithm/concept", and have a reasonably decent way for the person to see it.
..  In a familar'ish, compatible'ish, BASIC'ish language.

I've managed a few decent games, though.  You'll need a half-decent system to run more of the newer stuff, as I've tried to push the engine to its very limits.
But if you scroll through, you'll find a lot of the older games work really well on older tech.  It's held up, most of the time. .. So long as your browser's up to date, it oughta be good enough.

Reading pixels is a bit broken, though.  I think that's more of a Browser issue, than anything I've done to the code.  (I think!!)

A bunch of games coded in the language can be found here.  To varying degrees of success.
The Diggity Doo game will likely fail due to the reading-pixels thing, but most other games should run just fine.

If you want to run the most recent stress-test, you can find "Optimisationalism 4" here.  If you do give it a go, be sure to let me know the results :D
"Load, Next List"

Baggey

#12
QuoteIf you want a game engine, it's probably not the thing you want. And it wasn't really coded for that purpose, either.

No, I do not want a game engine? I want to code :-\ . Lazarus is looking good at the mo. Just need to code with out windows stuff slowing it down.

All i want is the fastest compiled code.  :o

If you want graphics make your own code.

if you want sound make your own code.


There is another language everyone is missing! MAGIC C++++! It only has one line of code! OKAY that maybe 3 or 4 lines of code!? :-X

Superstrict "and Lazy.bum"

IM IN A CLASS OFF MY OWN {
Make me a game because im to lazy to code!;
}

end game "Make me Money"

Im only joking! :-X

Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on Acer 24" . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Amiga mini, ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!

dawlane

#13
Quote from: Baggey on February 17, 2024, 20:21:36Lazarus is looking good at the mo.
I think your going to have trouble with Lazarus. Apart from the bugs, dodgy and broken packages, bad documentation and the random crash. You will also have to learn object Pascal, the FCL (aka Free Component Library), the RTL (aka Runtime Library), the Lazarus Component Library (aka LCL) and how to handle events.

therevills

I found JSE great to just bash proof of concepts code pieces together and get feedback on it with fellow devs :)

For example I needed help with parent child rotations:

https://gotojse.com/5kDsQlXH.BAS