Closed Thread Icon

Topic awaiting preservation: PSP development - no javascript involved (yet) (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=26558" title="Pages that link to Topic awaiting preservation: PSP development - no javascript involved (yet) (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: PSP development - no javascript involved (yet) <span class="small">(Page 1 of 1)</span>\

 
_Mauro
Bipolar (III) Inmate

From:
Insane since: Jul 2005

posted posted 08-30-2005 13:11

Hello world, the psp/js thread and the power of the psp have led me to
wanting to develop for that platform.

So I dug into this topic and came out with a quick reference, which I thought would be of interest to many people
at the Asylum.

http://www.emuboards.com/invision/index.php?s=1c7f2ae72d7044c1354d040f04a382ce&showtopic=22600

_Mauro
Bipolar (III) Inmate

From:
Insane since: Jul 2005

posted posted 09-02-2005 11:42

Here is another piece of advice, a golden piece of advice for psp developpers.
So far, we has a free/legal sdk, a free/legal emulator, so we had what it takes to compile,
and what it takes to run psp apps, for free.

Now, DEVcpp being a decent/free IDE for C/C++, we also have a free/legal way
to manage C/C++ projects for the psp: http://www.cs.purdue.edu/homes/ljbuesch/

This could be useless, or very useful: read the title again, no js yet.
Scott mentionned a js interpreter for the psp, and I just am thinking that...

Such a thing could be developped, quite easilly.

I mean, and this is a quite important question: why not putting together our very own, Asylum brewed, js engine for psp
(or for other platforms for that matter)?

This probably sounds "too big", but it is not, for example, FF is an open source soft, so compiling it for the psp is possible,
sparing the hassle of building a whole web browser.
FF has it's own js engine, and a Java one, both can be extended,
corrected, etc.

In the course of my psp investigations, I will most probably try to compile an "FF for psp" myself, for the hell of it.

End of rant.

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 09-02-2005 14:17

_Mauro: You can grab the source code of SpiderMonkey, Mozilla's C implementation of JavaScript.
I'm pretty sure I've seen some screenshots of FireFox, and Mame, on PSP. There's even a ST emulator.

_Mauro
Bipolar (III) Inmate

From:
Insane since: Jul 2005

posted posted 09-02-2005 16:13

Coolness, poi... am wondering what we could "give" to js, this said: if I have to recompile a SpiderMonkey,
why not taking the chance to make it "a little more special".

Hmmmmm.... say I would like to introduce a "canvas" object for generating pixels... on a device like the PSP.
Just picture generating your pixels to an img object on the fly on a gfx monster like a playstation.

Anybody's interested?

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 09-02-2005 16:36

If only I had 250-300? to put on a PSP with a decent size memory card
I've been told the PSP has a monstruous fillrate.

It could be awesome to generate some images and have a limited set of functions to map them on triangles. To ease a bit the work on extendiong SpiderMonkey, freeze the viewport. All the computation could be done in JavaScript.

_Mauro
Bipolar (III) Inmate

From:
Insane since: Jul 2005

posted posted 09-02-2005 16:47

Well, for the development part, all you need is the emulator.
Methinks this whole idea deserves a sourceforge project, and since sourceforge also give a free cvs,
this could be a huge Asylum "joint-project".

Me thinks you will get what you deserve me matie, Opera or not, good work gets rewarded, trust me,
so with the thousands of bucks a months you'll soon get, buying a psp to test what already worked on the emulator
will be history.

...Let me find time to get a hello world to work, this requires a usb2 cable and some software tweaking
(heard recent psp roms limited possibilities to run custom executables, will maybe have to circumvent that),
and when I am done with that, => sourceforge.

And anybody who's interested, feel free to jump in and shout out, preferably loud.

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 09-02-2005 18:03
quote:

_Mauro said:

Coolness, poi... am wondering what we could "give" to js, this said: if I have to recompile a SpiderMonkey,why not taking the chance to make it "a little more special".



I'd like to do a few things (some of which others have proposed):

change the term "function" to "fn"
change a number of consistency issues concerning the object model
heck, simplify the object model to begin with
regularize use of commas
make the for..in loop nicer (and, additionally, make a way to access keys instead of just values in arrays)
add ||=, &&=
add a type() function, to determine what sort of object something is (array, function, etc.)

maybe I should just make my own language based on JS

---
Website

_Mauro
Bipolar (III) Inmate

From:
Insane since: Jul 2005

posted posted 09-02-2005 18:21

Maybe... hmmm, I am trying to understand your ideas, and having a "not so easy time" - don't get me wrong though,
I value your input, that's why I will have a not so easy time, to get to understand your proposal.

Why function to fn? I know, hell, everybody knows coders are lazy, but is there another reason?
to me, this would limit the range of possible short variable names.

Consistency issues concerning the object model... hmm. Are we talking js-strict object model?
In this case, it's five objects (Math, Date, array, etc.). Are we talking document object model?

Regularize use of commas, as in "preventing 70 instructions to be packed as one line of code"?

make the for...in loop nicer is fine by me.

||= and &&= are above my head: man, these ones are the comparison operators, not the logical operators.
How do I do something like if(condition &&= stuff) ?!?
Do you mean doing stuff like "int variable &= bitmask" instead?

And type functions... I've got some snippet, somewhere, God knows where, which does this in pure/strict js. Granted, it would be nice
for debugging purposes.

-----------------------------------------------

On to my own "wishes" for js: a core-js canvas object, independent of the Dom, which would grant access to an offscreen buffer
for creating "memory image sources" analogous to the ones found in Java (or loading them from picture files).

While we're at it, a core-js "sound" object, for the same purposes, but using sound, with streaming capabilities.

And while we're at it, a "bitebuffer" object that can easilly output several types of data. Hell, ANY kind of data given
a mime type.

The latter would bring in some serious security concerns, though.

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 09-02-2005 19:00

_Mauro: Sure, I could buy a PSP but I doubt I'd really use it until a while. I still have to make the last touches on the final version of Neja and will make a screen/intro on Atari for the 20years in the row.

quote:
And while we're at it, a "bitebuffer" object that can easilly output several types of data. Hell, ANY kind of data given
a mime type.

You can already do this in plain JavaScript. Generate an <object> tag and feed it with data: URL built in JavaScript. You can do absolutely ANYTHING. The only limit is that of the strings accepted by the language/interpreter.

Iron Wallaby: Why fn instead of function ? Is it just to conform to the syntax of a language you are familliar with ?
What do you have in mind for the for( i in myVariable ) ?
||= and &&= could be handy, but actually doing &= and |= has the same result since 0 is considered false and anything else is true.
There is the typeof operator.



(Edited by poi on 09-02-2005 19:03)

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 09-02-2005 22:30

First, for "function" to "fn": Because I tend to use a lot of anonymous functions, I would do this because A) it reduces vastly the amount I have to type, and B) it maximizes horizontal screen real-estate, making it so I can see more code at once, which is a very valuable asset. The less you force a programmer to type, the better off they are. This is why I don't like Java, for example (where I have to type 3 wide lines to make a simple feature, due to the way it does objects. Which isn't necessarily a bad thing, I just don't like it). (And no, I don't know any current languages that use "fn". I do know that the Arc dialect of Lisp, which is still under development, uses "fn" instead of "lambda".)

By making the object model consistant: doing the following two are equivalent:
var foo = function () { this.bar = "hi!"; this.moo = function () { return "cow"; } }
var foo = { bar : "hi!", moo: function () { return "cow"; } };

We don't need both. We could thus simplify and make more consistent the syntax.

Regularize the use of commas: InI, you are correct on some level, but to be more precise: there is a fine line in most languages between a statement and an expression. In JS there is no such distinction it seems, and so commas allow you to separate expressions, which are equivalent to statements. It just makes the syntax more complex where it's not needed to, and it could be made more simple.

While &= and |= are very useful (bit masking and so on), I don't always just want to work with bits. I may want to work with booleans. I have come across many cases (both in raytracting, adaptive rendering, and a few other uses) where an &&= or ||= operation would be very useful. I mean, this is a purism issue: Boolean objects exist so I can use them as Booleans, and not have to typecast numbers. Sure, I can currently typecast numbers (and currently do), but I shouldn't have to. And as it's a simple add-in to make, why omit it unless you want to omit +=, -=, *=, /=, etc?

Currently, with "for (i in foo)", i becomes the name of each property in foo. I'd rather "i" became the ACTUAL properties. This is because I don't want to have to make new local variables before using the command.
For example:
var foo = bar.makeAnArray(); for(var i in foo) { alert(foo[i]); } // we need to be able to reference foo

What I want to do is:
for(var i in bar.makeAnArray()) { alert(i); } // shorter, don't need a foo variable

The typeof operator currently in place is inconsistant. e.g. a number constant and a Number object are two very different things. They shouldn't be! They should be identical. Also any object is considered an Object, not an Array, Date, etc.

Sorry that it's not all nicely formatted... have a bad cold and my head is pounding.

---
Website

_Mauro
Bipolar (III) Inmate

From:
Insane since: Jul 2005

posted posted 09-03-2005 22:17

Ok, thanks for the pointers.
To expand on my views, poi, I was thinking "encapsulation", I don't want to handle my bytes as chars, and byte arrays as strings, I like them as... say, integers, for instance.

This said, I am compiling my first psp executables right now.. yummy!

« BackwardsOnwards »

Show Forum Drop Down Menu