codefrau / SqueakJS

A Squeak Smalltalk VM in Javascript
https://squeak.js.org
MIT License
365 stars 75 forks source link

asm.js #61

Closed francescoagati closed 1 month ago

francescoagati commented 8 years ago

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?

codefrau commented 8 years ago

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?

francescoagati commented 8 years ago

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" notifications@github.com Inviato: ‎24/‎06/‎2016 19:58 A: "bertfreudenberg/SqueakJS" SqueakJS@noreply.github.com Cc: "francesco agati" francescoagati1975@gmail.com; "Author" author@noreply.github.com 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.

codefrau commented 8 years ago

You're very welcome to try :)

francescoagati commented 8 years ago

ok i try ;-)

2016-06-24 20:19 GMT+02:00 Bert Freudenberg notifications@github.com:

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 .

codefrau commented 1 month ago

Closing for inactivity