Wondering how well Deno ( deno.land/ ), a "secure" Node, would work as a game platform for home users.

Is this the new 8-bit BASIC?

h/t @teleclimber for bringing Deno to my atttention

@natecull @teleclimber gamewise i don’t see anything here you couldn’t do in a browser. but with deno you’d have to a do a bunch of extra setup. deno is very much about correcting the mistakes ryan dhal thinks he made with node, and thus it’s squarely in node’s original usecase: small realtime server. though i see it’s got an api that shows it could do electron’s job.

@natecull @teleclimber it seems there’s an enormous gap in communication and education, meaning most developers haven’t the slightest clue just how much amazing stuff is possible with just a plain browser without needing to add a framework on top.

@zensaiyuki @teleclimber

It might be because "just plain browser" got a very bad name back in the IE vs Firefox wars, and so everyone ran for the shelter of frameworks as protection against all the unimplemented and half-/buggily-implemented browser stuff? And now that "framework first" mentality has stuck?

@natecull @teleclimber yeah basically. all the problems the frameworks were built to solve aren’t actually a problem anymore, but now we already have all this stuff built in the frameworks.

@natecull @teleclimber but if you went looking for a simple primer, for beginners, on how to do a hello world in plain javascript, they basically don’t exist.

@zensaiyuki @teleclimber

I admit that when I looked at Node, about two years ago, I found enough weird and dangerous things in its vanilla Javascript that I ran screaming for at least Ramda. (Lodash probably does what Ramda does, now).

I can't imagine using out-of-the-box Javascript even in 2020 without at *least* a utility library. So much really vitally important stuff Just. Isn't. There. in the core language. And what is there, often has really nasty side effects.

@zensaiyuki @teleclimber

actually what actually happened was I started making up my OWN utility library to make Javascript safe and sane. Then found that Ramda / Lodash etc had already done that.

@zensaiyuki @teleclimber

just utterly insane things like, there's no builtin functions (or at least not sensibly named, easy to find ones) to test whether an object is an array, is Null or not, fallbacks for Null handling, vanilla 'sort' is DESTRUCTIVE, yeeeeagh. Things that, if you're doing database-query type stuff, you just don't want anywhere near your code.

@natecull @teleclimber that stuff has all been fixed. just for some reason nobody gets the memos for these things.

@zensaiyuki @teleclimber

It *hasn't* been fixed. Or rather, the dangerous, unsafe stuff is still there right alongside the correct stuff.

So, much better to never trust the builtins, just indirect everything through a different namespace. Otherwise for every single method call you have to go 'is this one of the good ones? or the evil ones?' and you'll occasionally get it wrong.

@zensaiyuki @teleclimber

I would *love* it if there was an 'ultra strict mode' that just REMOVED all the old and evil and wrong methods. There's probably a library to do that, but... well, just using a library seems the easiest way.

@natecull @teleclimber it’s called ESLint. it’s not built in or anything. but again, yes this is the problem. there’s simple solutions to all these things but if you are a beginner and you go looking, you will be frustrated and go half mad.

@zensaiyuki @teleclimber

Basically you need an "index of forbidden methods".

Eg: never ever ever use charAt() always use charCodeAt(). Because charAt() doesn't do proper Unicode. but it's still there. Etc.

@natecull @teleclimber in point of fact, despite my advocacy, I reccomend processing / p5.js to beginners who just want to dink around with a modern basic/logo equivalent.

@zensaiyuki @teleclimber

Oh yeah! I heartily recommend p5.js. I discovered it a few weeks back, and love it.

@zensaiyuki @teleclimber

Is there something similar for just 'I want to print a bunch of text'?

I presume it would be just a very tiny library, maybe five lines.... but is there one? An ultra minimal 'bootstrap the equivalent of BASIC text mode in the browser'?

@zensaiyuki @teleclimber

Like you immediately get crippled by 'because of security, there's no equivalent for 'Insert tape, read/write data file'.... which is the sort of thing that started me off on my whole rant earlier about browsers locking down the filesystem.

@zensaiyuki @teleclimber

The browser has become our VDU.... but in 2020, the browser still can't give us the equivalent of a CP/M machine with safe, local disk storage. In fact all that's being taken away from us.

@zensaiyuki @teleclimber

I can (and am looking at right now) run an entire emulated BBC Model B Computer running a BASIC adventure game in the browser... except there's no way of saving the game because, shrug, browsers aren't allowed to write to the local filesystem. Even just to one designated file selected manually by an out-of-browser 'file open' dialog box.

@zensaiyuki @teleclimber

... or DO we have this capability, finally? Do we have a File Open box now?????

@natecull @teleclimber we do, it’s been there for years. i don’t know where you’re getting your information that it doesn’t exist. there certainly are limitations, but you kinda want them.

@zensaiyuki @teleclimber

I guess I'm getting my information from nobody ever using it! Like, for instance, Tiddlywiki writing a whole baroque EXE plus plugin system to implement saving!

So it's there and it works? Cross browsers? And we can save files in it? And remember the file name across browser invocations?

@natecull @teleclimber well, if you want to go onto your file system and see a persistent file there, then no. but there’s nothing stopping you from using the data persistence apis together with the blob apis to save a file in the browser storage and download it on demand.

@zensaiyuki @teleclimber

Problem is I don't trust the browser storage to not get deleted.... I just want to load and save normal files! Without that, I still can't really use a browser as a comletely *local* application engine, can I?

(Is that the use case for stuff like Electron?)

@zensaiyuki @teleclimber

like I wouldn't mind if, eg, I had to manually associate any given URL with a local folder, and then it couldn't ever access anything outside that folder (unless I manually accessed the file navigation UI, which the browser wouldn't be able to fake). I think I could cope with that level of manual intervention and I think that would give enough security maybe?

@zensaiyuki @teleclimber

Omg yay! That's exactly what I want. Then I could write local apps, as HTML pages plus Javascript, that never needed to touch the Internet, and can still do stuff locally.


@natecull @teleclimber you can also create little node servers that do the writing to the local filesystem part. electron is popular but in the end it’s just chrome packaged together with a local node server with a versioned api for how everything integrates.

@natecull @teleclimber see i am a bit of a radical and i think fundamentally filesystems are a bad idea and if we can avoid ever using them we should. the main reason we are still kinda forced into using them is it’s the only non limited way we have of sharing information between systems, so if someone forward thinking like apple stops us from having a “real” file system it can feel like handcuffs when we want to get data in or out.

@natecull @teleclimber of course apple caved, and as a result i now need to choose from like 8 different ways to handle images i want to download, when in the good old days the image would just go to my photo roll and that would be it.

sure it sucked when i got a link to a zip file and there’s still no good way of dealing with those on iOS, but i’d prefer it if we were thinking up nicer solutions instead of just rebuilding 1980s ideas.

@zensaiyuki @teleclimber

I wouldn't, in principle, be *completely* against replacing filesystems, with some kind of object store, as long as

1) I can still preserve my data as readable and transferrable to other media on a timeframe of at least several decades

2) access to my data is not gated through any Internet-connected entity.

I want the right to have my data stay physically local to my machine, and the right to copy and move it onto physical media.

@zensaiyuki @teleclimber

By 'my machine' I also include something like 'my house file/cloud server', if there is such a thing. But I want to be able to minimise data transmission as much as possible, and keep data readable for the future.

@zensaiyuki @teleclimber

If we had some kind of 'object soup' instead of a filesystem (maybe with files grandfathered in as one object type?), I think there'd need to be a way of isolating all the connections from any given recursively contained part of that soup, to others.

So that we could get the equivalent of 'copy just this one folder', which I think is a really useful semantics for information sharing. If we had that plus '... and all the objects referenced from it', it might be cool.

@natecull @teleclimber the appealing thing about a file is that it’s a fucking thing. humans can deal with fucking things. we can’t as easily deal with giant webs of interdependant references, as i’ve seen you musing about.
the mac classic file system was really something though. each file could have a blob of data in it, sure, as you expect, but each one also had a database associated with it. if you’re an app developer you could just write to that database, and that’s your “file”

@natecull @teleclimber so you could really split the concept of “file system” into two peices: the physical inplementation, and the UI that presents users with “things”, and the list of affordances those things permit. the physical implementation of the thing doesn’t really need to be a stream of bytes.

@zensaiyuki @teleclimber

Agreed, a stream of bytes is not very wonderful, it forces every program to be its own from-scratch parser, which is a hassle and a security nightmare.

I wonder though if we could do something like I'm suggesting (eg: gather up all the external references and bundle them together) for object-soup systems. I feel like it would solve a lot of issues we currently have with package management, version control, etc. The same pattern happens again and again.

@zensaiyuki @teleclimber

like imagine if you could just copy a local HTML file to an external drive, and the act of doing that did a wget on all of its links and bundled those with it. Something like that. Only not HTML, with JSON or Smalltalk or the equivalent, and maybe with some sanity checking so there's a maximum size it will try to bundle.

@natecull @teleclimber so something like what nom does when it downloads all of a project’s dependencies, but hopefully less crappy?

@zensaiyuki @teleclimber

I guess! You'd think that we would have reimplemented this pattern so many times now (starting with Lisp closures) that it would be second nature, but, I guess all the bugs aren't worked out yet.

@natecull @teleclimber the trouble is if course is do this with any arbitrary web page and you just end up downloading the entire internet. the trouble with “object soup” is the lack of a clear boundary around the fucking thing.

@zensaiyuki @teleclimber

Yeah, boundaries I think always were the problem with Lisp and Smalltalk systems too. Why 'images' became the format and were seen as too cumbersome compared to files... ... but now with file-based systems being not just one VM but whole clusters of VMs, it's not enough just to give someone a VM, they need the whole meta-environment that can launch that VM .....

@zensaiyuki @teleclimber

It seems like a similar problem to, what if I did the 'Zettelkasten' technique and had one big card file for all my personal information. Then what happens if I want to give part of that to someone? Is it possible to cleanly partition a card file? Which links is it okay to keep hanging?

@natecull @teleclimber i feel like maybe this was the missed lesson of smalltalk’s OOP. not that I’ve used it, but i think the idea was an “object” was supposed to be “the fucking thing”, and that you should be able to expect to pick up an object, stick it in an entirely foreign system, and have it just fucking work without it complsining about missing libraries. that the boundary of the object is message passing, not binary or lexical linkages. like the js worker api.

@zensaiyuki @teleclimber

But of course it turned out that an object always relied on a whole bunch of other objects, and there was no way for objects to 'literally contain' other objects other than just referring to them. So we got all sorts of non-object metaphors for 'containment'. Modules, libraries, packages, projects...

@natecull @teleclimber we have a whole “microservices” architecture that’s really just enforcing object boundaries with a network interface. nothing you can do over a network except message passing.

you could do all that same stuff in a single process of course, but if it’s possible to just passively reference something, you definitely will, instead of designing a protocol for communication with the thing using messages.

@natecull @teleclimber so, i think that’s the key is if you want a thing to be self contained, it can’t reference or depend on anything, and where possible it interacts only with the outside world via messages.

it’s still possible to build a house of cards out of that but the goal would be to design the system to make not doing that the easier choice

@zensaiyuki @teleclimber

Is there anything *wrong* with just passively referencing something, though?

I suppose the genius of Smalltalk was to make the idea of message-passing nearly invisible: you had what looked like just a reference (and in C++, compiled down to pretty much just a pointer) but, supposedly, you got the rich message-passing semantics. Best of both worlds.

Except maybe we didn't quite know what semantics we actually needed for our messages? And still don't?

@natecull @teleclimber well, it certainly gets the job done, but i think we already established what’s wrong with it: broken links, conflicting versions, dependency hell, 30mb javascript bundles. etc etc.

@zensaiyuki @teleclimber

like I can write a system which is based on messages to the Google API, but if one day Google change their API, whoops, it still sends messages but nothing works.

That exact thing happened to the "Smart TV" with a Youtube app that we bought in 2012. TV still works, app does nothing because Google changed the Youtube API.

@natecull @teleclimber that is an important and relevant point. which is why there should be a set of *standard* apis but there isn’t because kyapityalism. if youtube goes down i should be able to just plug in the url for vimeo or whatever and everything works the same.

to be fair, there is dlna, but i guess it’s long in the tooth.

APIs are contracts. promises. a changed api is a broken promise and should be treated with the same social stigma.

@natecull @teleclimber but we don’t have anything in the api world nearly as ubiguitous as say, jpeg is for images. or unicode for text. http is sorta it but it does not cover use casss like “streaming video service”, and we likely won’t have that because many people’s salaries depend on us not. but for other common use cases there should be like, standard name recognised things for photo galleries, music libraries, etc. and there kind of is but the landscape is neglected

@natecull @teleclimber for half a second, rss and derivatives looked to be something like this for peices of content. despite everything, podcasts have a standard and ubiquitous api.

@natecull @teleclimber on the smaller scale, objects communicating with each other within a program, “interfaces” permit a level of polymorphism. if you write a video playing website, you could in principle put any object with a width a height and a play method in place of a video.

@zensaiyuki @teleclimber

and then if you copied that folder back into another system, it would only merge in the objects that were new, and hopefully it would also record that this was one atomic changeset and let you back it out.

That's probably where the problems come in, I guess. What happens when there are changes, and if you back out a prior change but want to keep later ones...

Sign in to participate in the conversation

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!