SqueakJS icon indicating copy to clipboard operation
SqueakJS copied to clipboard

asm.js

Open francescoagati opened this issue 9 years ago • 4 comments

hi, what do you think about compile some parts of squeakjs in asm.js. For example the canvas rendering code. I don't konw if this ideas has been explored. What do you think about?

francescoagati avatar Jun 24 '16 16:06 francescoagati

I thought about it but have not tried it yet. It would indeed be nice to use asm.js e.g. for working with bitmaps (BitBltPlugin). But SqueakJS is an object-oriented VM, meaning it represents Squeak objects with JavaScript objects. In asm.js you only get a single huge TypedArrary as your memory, and all functions have to operate on that chunk of memory (it basically models a C program's heap). We would somehow have to map between the real objects and that binary memory array, and I can't think of an efficient way to do it. But perhaps you have an idea for that?

codefrau avatar Jun 24 '16 17:06 codefrau

I think only for function with heavy math that manipulate only number or typed array. And graphic canvas is much funcrion ceunch number.

----- Messaggio originale ----- Da: "Bert Freudenberg" [email protected] Inviato: ‎24/‎06/‎2016 19:58 A: "bertfreudenberg/SqueakJS" [email protected] Cc: "francesco agati" [email protected]; "Author" [email protected] Oggetto: Re: [bertfreudenberg/SqueakJS] asm.js (#61)

I thought about it but have not tried it yet. It would indeed be nice to use asm.js e.g. for working with bitmaps (BitBltPlugin). But SqueakJS is an object-oriented VM, meaning it represents Squeak objects with JavaScript objects. In asm.js you only get a single huge TypedArrary as your memory, and all functions have to operate on that chunk of memory (it basically models a C program's heap). We would somehow have to map between the real objects and that binary memory array, and I can't think of an efficient way to do it. But perhaps you have an idea for that? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

francescoagati avatar Jun 24 '16 18:06 francescoagati

You're very welcome to try :)

codefrau avatar Jun 24 '16 18:06 codefrau

ok i try ;-)

2016-06-24 20:19 GMT+02:00 Bert Freudenberg [email protected]:

You're very welcome to try :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bertfreudenberg/SqueakJS/issues/61#issuecomment-228421099, or mute the thread https://github.com/notifications/unsubscribe/AAKtpEx0oHwLRzguIrgxvdPRC-fVz3Qmks5qPB-xgaJpZM4I97WX .

francescoagati avatar Jun 24 '16 18:06 francescoagati

Closing for inactivity

codefrau avatar May 05 '24 04:05 codefrau