Snap! outside of a browser

update: it's on github now

ah, yes, i made this buggy mess of Snap! 4.0 beta (first commit in the github repo) in node.js that only modifies Snap! at runtime to generate module.exports = {...}; lines so that the Snap! js files can be used as (pre-es6) modules

Hi! Good to see you again.

But I have no idea what I'm looking at. :~/

ok i fixed the sizing issues


but there's still the problem that WorldMorph.fillPage only seems to work when the window is initialized, and also dragging anything makes everything super laggy

lmao i don't know either

I think it's a reimplementation of the browser canvas outside the browser.

that (skia-canvas, made by samizdatco on github) and a bunch of stubbing of window, document, etc. (stuff a browser gives that node.js doesn't give in the same form)

yay script pic works (convolutedly, but it does work)
image

lavaScript


untitled script pic

But that settings menu seems much more up to date than 4.0!

I guess this would be useful if you then invented primitives for things that browsers don't support: local filesystem i/o, hardware control, stuff like that.

that's because i switched to using Snap! 9.2.18 for the screenshot with the settings menu open

if i did implement primitives for that i'd either have to make another script to do it that detects what the version of Snap! being used supports in that way and add them without actually modifying Snap!'s code. currently i have no plans to do that, and all i'm focusing on right now is making Snap! run outside of a browser without modifying it aside from what's required to even have it be able to use stuff like WorldMorph in gui.js, or document, or whatever

That's what our new extension mechanism is for! :~)

yes, but what about versions before it was added?

Do you know a Snap4Arduino - may be used as a desktop version of the Snap! extended with the Arduino/Firmata support

And

my thing has a different goal from Snapp!--Snapp! makes Snap! projects run outside of the browser, whereas my thing makes the Snap! editor run outside of the browser

however, i will take a look at Snap4Arduino

Edit: i have looked at Snap4Arduino and it appears to bundle Snap! at build time, which is also not the goal for my thing. what i'm intending my thing to be is more of a Snap! version launcher, that can launch any version of Snap! (and potentially other similar web applications that use the same "the canvas is (almost) everything i use" framework that Snap! uses)

So, what's your actual objective here? Why would you want to run older versions? And, do you have specific "other similar web applications" in mind?

As you know, there is no Editor, just :snap: IDE in a "full screen" mode. Empty project starts a :snap:@Snapp.

So you really want to build a custom browser app to run the external site without the proper sandbox.
Whats wrong with the Electron or NW.js frameworks? They already bundle Node + Chromium to build a platform native app.

BTW: running a remote site with the upgraded privileges of the native app is considered harmful.

Do you want to expand the Snap capabilities this way?

perhaps i'm being influenced by Omniarchive and related projects, that are about archival of Minecraft (and the playability of old versions thereof)

no, just anticipating potential futures

the answer is

i.e., it isn't native, and requires the overhead of a browser, and Chromium is notorious for using way too many resources. even Firefox uses a lot of resources, and the lightweight browsers there are are pretty much all either super old (implementation-wise), don't support javascript, or don't even use a gui

Edit: i don't know how i didn't think of this but my thing still doesn't make it native, though the other point is still valid

I'm going to follow this thread, because this is very much my interest.

The answers warped has gotten so far sadden me though. They've decided to explore something "advanced" and the answers basically boil down to "why" or "use existing"

It's not really teaching them anything is it?

but it does give me the opportunity to think and to discover

also, i tend to do better explaining something when asked "why" or "what" or "how", rather than explaining up front, so i quite appreciate such questions. to use a metaphor, my thought process when describing something is much like lazy evaluation