And now I'm announcing the second and final project I'm starting today: "Memex", a new and hopefully more hackable, less crackable browser engine.

It won't support JavaScript, and instead try out some alternative ideas that aren't Turing Complete. Because I want to show The Web can be better that way.

I'll only be able to implement the absolute basics of Memex, so if any of you want it to actually be something please, please contribute!

@bugaevc That's what Rust was designed for, isn't it? And I get to reuse pieces of Servo this way.

Though Brix is also in Rust for non-code reuse reasons.

@alcinnz i wrote a thing in javascript.. Basically a server sends patterns, and data to fill in the patterns. Patterns can also have sublists;

Into the stream, it inserts the pattern,(if not sent yet) and then the stream of objects the function_name produces.

I also got static pages going.(right now, just running the javascript server-side)

The idea is to add basic forms too, so a sublist can be extended/replaced.(bit like html forms)

@alcinnz want to eventually add javascript functions to the patterns. So things-from-the-data can be calculated a bit.(maybe this goes against your purposes, but could turn it off)

And like compressing it down more with bson, and maybe even some datatype description on the patterns.. Although i guess, this would be mostly a very minimal savings, compared to even a small image.. Though can look at it from another perspective; usablity in extreme low bandwidth w/o images..

@jasper Do you mind sending me links?

I'd like to bring it up on a mailing list I've got.

@alcinnz it was a bit tangled up with another project, but i untangled it.

@jasper Interesting read! What was that other project btw? I'd like to see how JSPat can be used.

And can I summarise JSPat by saying it works by substituting arguments in where "{%"..."}" is encountered, and evaluating any template expressions that generates?


1. the macros depend on what the object is providing.
2. sublists correspond to methods on the objects, and return lists(generators) of objects that then do the same.

It's hoped to easily compose pages this way.
3. no back and forth, patterns are pre-read for info on what sublists are needed.

It is also partially avoiding logic constructing things browser-side, yet construct them there anyway.

Of course, it includes javascript, but perhaps an addon or userscript can take over.

@alcinnz or the browser could provide functionality otherwise.

Oh and with the assets, i usually use layers of them, searching a list of directories and using the first match.. Like the idea of customizing. Though it's server-side so far, not browser-side. No reason browser-side couldnt be added, though not sure how much certainty one should put in session storage.

@alcinnz The bigger project..

It basically allowed adding more things to objects like `.fmt_`, `.rpc_` and `.fmt_get_`, `.rpc_get_` based on the format it would choose "classes that do formats and handlers" that would handle the output of the functions. I.e. `json` would be json encoded, i also wrote another pattern expander, plain assets, raw strings.

Now i wonder if there was much point in that. Maybe this is better. (though it needs better plain-asset sending?)

@jasper There did seem to be something about macros being involved in the definition of macros, but maybe I didn't understand that right. Some sample usage would be a help in wrapping my mind around it.

Avoiding logic is definitely a goal of mine, so it's good that the output isn't regarded for patterns. Because then you'd have an interesting expression of Lambda Calculus.

@alcinnz when in the string it sees something like `{%fun_name|arg1|arg2...}` just calls a function by the name, with those arguments, and a state.

With the return value, if a string, it just inserts in place.(even if it contains `{%..}`) If a list, it contains more things to expand, so it will do that.

The state is used to pre-calculate what is needed, for instance `{%c|name}` lists `name` as a needed part of the object. And `{%sublist|...}` figures needed patterns.

@alcinnz JSPat/obj/ contains some examples..

asset_page = ["div.html", "<h3>{%c|path}</h3><p>{%c|mode} creation time:{%c|ctime}</p>{%sublist|table|dirlist|entry}"]

Put in a `<div>` tag, the tag component (returned by `jspat_data` above) creation time, etc.

After the </p> sublist, tells it to use pattern below(`entry`). And `jstpat_subgen_dirlist`, and to put it in a `<table>`.

asset_entry = ["tr.htm", "<td>{%c|path}</td><td>{%c|size}</td><td>{%c|ctime}</td>"]

@alcinnz it `asset_entry` doesn't use {%sublist, so the recursion stops.

The other, `asset_sub_entry` and `asset_sub_page` are used to (limitedly)test if it can do a layer deeper. It uses the `JSPat.obj.Date` object which is the same kind of thing.

Sign in to participate in the conversation

For people who care about, support, or build Free, Libre, and Open Source Software (FLOSS).