Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
coookie26158yThis sounds interesting, would love to hear more about it, how would it work? How does your virtual processor interact with engine or is it something else?
-
@coookie sorry was out.
Tangible is written in JavaScript. The way it works is it just interprets instructions and does what the instruction tells it to do.
here's an example program:
mov reg0, 5;
mov reg1, 6;
add reg0, reg1, reg0;
although technically, if this is unused clang will remove it...
the equivalent javascript:
var a = 5 + 6;
interesting thing with this I can also simulate a GPU (which is a lot harder) and you can make opengl calls instead of webgl. -
@coookie the other thing you could do if this caught on, is to rewrite the specification for the processor in c++ for web browsers native instead of javascript, vastly increasing the performance.
-
@coookie one problem I ran into is integers... javascript supports 52 bit variables, which is a problem for me, so I had to redefine a new class for variables, memblocks! Memblocks are blocks of memory that get allocated using Mallorca, reallocated, and free. it contains the number of bytes you wanted and an Id tag.
-
@coookie tangible is a processor simulation. Which means you write assembly for it, or use a compiler to compile to the assembly. It replaces the need to use CSS, html, or javascript.
-
@mclovinit yes, it has assembly instructions like. real processor, it uses 256 registers and a stack.
the move instruction is 0x01. -
coookie26158yHow are those assembly instructions executed in browser? Sorry if this question sounds dumb 😶
-
@coookie oh no, it's not dumb 😋
basically it loops over the bytecode you've compiled to and then has a giant switch case.
so:
switch (byte_from_stream)
{
case 0x00:
{
// null, do nothing
}
case 0x01:
{
// move value to register or place in ram.
}
..... and so on
} -
@coookie the various instructions can also do things like there's a call instruction. The call instruction can call a function. This is how you program interacts with the web browser.
so when you tell a video player object to render, it sends a signal through Tangible and tangible updates everything and renders the video frame. -
coookie26158yOh so that means, Tangible has to be pretty deep inside the browser, probably sitting along side with v8 or any other engine?
-
@coookie Tangible is a specification as well as a piece of software, meaning you could implement it in any language, c++, javascript, PHP, anything Turing complete. However, if it were running not in JavaScript but in the browser natively it would be much, much faster.
Related Rants
-
ahmedam23What only relying on JavaScript for HTML form input validation looks like
-
isaacWeisberg21Me and my wife are software engineers Started dating while doing a project together I guess you could say that...
-
JMoodyFWD48My "Coding Standards" for my dev team 1.) Every developer thinks or have thought their shit don't stink. If y...
OK so... project I've been working on! It's a virtual processor that runs in the browser coded in JavaScript. OK so I know, I know, you must be thinking, "this is crazy!" "Why would she do this?!?!" and I understand that.
The idea of Tangible is is to see if I can get any tangible performance over JavaScript. I've posted a poorly drawn diagram below showing how tangible works.
The goal for tangible is to not use html, javascript, or CSS. Instead, you would use, say for instance, c++ and write your web page in that, then you compile it using my clang plugins and out pops your bytecode for Tangible. No more CSS, no more html, and no more javascript. Instead everything from a textbox to a video on your web page is an object, each object can be placed into a container, each container follows specific flag rules like: centerHorizontal or centerVertical.
Added to all of this you get the optimization of the llvm optimizer.
undefined
tangible
web development