Instead of writing <html> if I use it's binary code will it work? | Sololearn: Learn to code for FREE!

+2

Instead of writing <html> if I use it's binary code will it work?

/*computer understand 1s &0s */ will it get this:<0001101> instead of <html>

11/15/2020 9:32:57 PM

Web Sad

14 Answers

New Answer

+4

EDIT: check David Carroll 's answer Web assembly might be the future of web developement and it will support binary, but if you are writing classic html, css, js programs then it won't with

+8

Web Sad As explained by Martin Taylor ... That would be a no if attempting to pass those instructions via the browser. That said... the HTML does eventually get converted into instructions that get processed by the CPU and read as binary. 😉

+7

Not exactly, but the characters in the html file represent text, which can represnt binary Sadly that will not work

+6

Bhavya It's doubtful on at least 2 counts... 1. WASM won't have access to the DOM, which ultimately would be part of the flow for HTML to DOM to bytecode to native CPU instructions. 2. WASM is the compiled build target of LLVM IR (intermediate representation) of a higher level language like C++, C#, Kotlin, etc. That is, we can write code in a higher level language, compile to LLVM IR which is then compiled to WASM. But that WASM still needs to be compiled to a baseline WASM bytecode, then compiled again into the resulting native code optimized for a given CPU architecture. As you can see, there's still a good number of steps beyond WASM before binary is resolved. So... it's highly unlikely WASM would parse binary instructions for a given CPU.

+6

While the OP is likely asking this in the most basic and literal of ways... it's more interesting to think of this at the more abstract and conceptual levels. Consider the point in time where HTML is loaded and parsed by the browser. The HTML is essentially being executed as declarative programming instructions to initialize and load the DOM into memory. To this degree, the markup language, as unpopular and uncomfortable as that might be for many, is in fact, a special, domain specific programming language. At this point, Javascript is able to manipulate the loaded DOM as well. The DOM, loaded in memory, rich with events and event handlers, will trigger updates to the browser rendering engine which ultimately results in sending the CPU (or GPU) the proper instructions for controlling each illuminated pixel. It's the set of binary instructions applied to a set of affected pixels that I found interesting for this question. Granted, this description is still an oversimplification of what's happening.

+5

I find this question very interesting

+4

David Carroll nice details about wasm

+4

Rashed-Ul Anwar It's only ODD if the first bit is ON. Otherwise, it would be quite EVEN. 🤣😂

+3

I am in no way an expert, but no code anyone writes is directly processed by the cpu (idk about assembly though). Most programming languages are either interpreted or compiled, so theres a layer between the code and the cpu. HTML isnt even a programming language, so even if you could write code like that it wouldnt work. HTML is more like browser code than cpu code; its interpreted by the browser rather than a compiler or interpreter. Sorry if this is wrong, I am not very experienced in how programming relates to hardware (unlike David Carroll , hes like an expert at this stuff.)

+1

test it and see for yourself

+1

did you test it yet?

+1

Web Sad Bro....Honestly speaking it will be very ODD using binary numbers....