[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: file.png (42 KB, 882x592)
42 KB PNG
Imagine how much more advanced web development would be if HTML looked like this
>>
>>108718021
yeah but the page sizes would go up cause json is bloated
>>
>>108718021
how would
<div class="whatever">cannot into <b>bold</b> text, saar</div>

work in a json?
>>
>>108718043
This and also, what if an element has multiple child elements of the same tag?
Any JSON schema where the order of keys must be preserved is fucked by design.
>>
File: file.png (31 KB, 652x505)
31 KB PNG
>>108718043
Shrimple
>>
>>108718021
I already program like this with HTML in s-expressions in Scheme.
>>
>>108718021
css should look like that too desu
>>
I think it would be horrible...
HTML its already horrible...
All the technology is horrible
>>
People who never learned HTML want to teach us how to do markup language. Seriously, just stop with this json nonsense. HTML/XML is great for markup, not so great for config/data objects. JSON is the opposite.
>>
File: 2026-04-29_21-20-13.png (15 KB, 452x278)
15 KB PNG
>>108718021
>>
>>108718111
Like this.

((doctype "html")
(body
(h1 "Sweet Header")
(p "Wat it do baby boo")))
>>
>>108718095
>bro reinvents JsonML
>>
>>108718021
That's just rsx if you use dioxus.
>>
>>108718021
now add a comment LMAO
>>
>>108718021
>>108718368
This has quotes and colons which are superfluous rsx doesn't
>>
>>108718021
can you stop being a fucking retard for 5 fucking minutes? this is the most retarded shit i've ever seen.
>>
>>108718111
>program
>html
>>
>>108718021
Stupid and unnecessary change no one asked for and no one will ever ask for
Let me guess, rustroon
>>
>>108718021
html should be replaced by javascript
>>
>>108718021
no, absolutely not. html describes structured documents specifically, not random data. json is meant to describe data objects. trying to describe a structured document in json is clumsy, obtuse, and ugly. it would make more sense to write an opera in mandarin.
>>
json is terrible

no comments and completely anal about superfluous commas
>>
it would look the same
modern websites are already like 5 lines of HTML that load 78,000 lines of JS
>>
>>108718021
what difference does the syntactical or typesafety make to the underline features the language has? its a simple markup language lmao
>>
>>108718021
Just wait till you miss a closing brace and try to figure out which one you missed.
>>
>>108718095
This looks totally fucking retarded and I say that as someone familiar with HTML and Jason Mewes.
>>
Web sucks. We need to go back to plain text.
>>
>>108718021
Imagine indentation hell in something more complex than simple html hello world. Some div block in the middle of the page would have indentation of 3 km length.
>>
>>108721404
You don't have to throw an error while parsing it. HTML pages also work even if you forget the closing tag.

>>108721542
Intendation is optional in JSON and HTML.
>>
>>108718021
json-sexuals should be beheaded publicly, they're even worse that sexmluals. If you want to improve sgml-like syntax you should go for s-expression, otherwise it's fine.

>inb4 sexpuals
>>
>>108721559
>HTML pages also work even if you forget the closing tag.
retard

<div><span class="red background">hi text</span>text that doesn't have red background</div>

Go ahead and remove the closing tags while preserving the same behavior
>>
>>108718021
>json
Bloat. Use CBOR.
Comparison here:
https://hildjj.github.io/cbor2/playground/
>>
>>108718021
Wouldn't the code look exactly the same? json isn't even particularly intuitive lets just go back to binary formats
>>
>>108718021
The serialization format of the data/conent doesn't matter tho, it doesn't make much of a difference if it's json, xml or some other funny format
>>
>>108718021
imagine if it was this instead:
(doc (doctype "html")
(html (head (title "Page title"))
(body (h1 "This is a Heading)
(p "This is a paragraph))))
>>
>>108718038
Right. HTML is document markup designed in an era when people didn't realize how retarded the the web would become as browsers became the universal client platform.
>>
HTML does not need to be fixed. CSS on the other hand...
>>
The only correct way to repr html and xml in json is basically as an array of tokens.
>>
>>108718021
looks like shit, why do you want writing html to feel like writing yaml. json is supposed to be an auatomatically emited form of data, not something that you write yourself by hand. what the fuck are you doing? i write my apis to egress json, not the other way around
>>
>>108718095
You've reinvented React
>>
>>108722848
Not op. I rather write JSONs than YAML any day. YAML is shit, even TOML is miles better.
>>
too many fucking quotes and colons
>>
>>108722215
>cbor
hobby shit. use ASN1
>>
>>108718021
mmmm I'm actually working on this.
Even have a Language Server Protocol up.
>>
>>108718021
Wrong. HTML should be compiled to binary.
// 8-bit enum for HTML element types (single byte each)
typedef uint8_t ElementType;

// Element type definitions (0x00 to 0xFF)
#define ELEMENT_UNKNOWN 0x00
#define ELEMENT_HTML 0x01
#define ELEMENT_HEAD 0x02
#define ELEMENT_TITLE 0x03
#define ELEMENT_BODY 0x04
#define ELEMENT_H1 0x05
#define ELEMENT_H2 0x06
#define ELEMENT_H3 0x07
#define ELEMENT_H4 0x08
#define ELEMENT_H5 0x09
#define ELEMENT_H6 0x0A
#define ELEMENT_P 0x0B
#define ELEMENT_DIV 0x0C
#define ELEMENT_SPAN 0x0D
#define ELEMENT_A 0x0E
#define ELEMENT_IMG 0x0F
#define ELEMENT_UL 0x10
#define ELEMENT_OL 0x11
#define ELEMENT_LI 0x12
#define ELEMENT_TABLE 0x13
#define ELEMENT_TR 0x14
#define ELEMENT_TD 0x15
#define ELEMENT_TH 0x16
#define ELEMENT_BR 0x17
#define ELEMENT_HR 0x18
#define ELEMENT_SCRIPT 0x19
#define ELEMENT_STYLE 0x1A
#define ELEMENT_META 0x1B
#define ELEMENT_LINK 0x1C
#define ELEMENT_INPUT 0x1D
#define ELEMENT_FORM 0x1E
#define ELEMENT_BUTTON 0x1F
#define ELEMENT_LABEL 0x20
#define ELEMENT_SELECT 0x21
#define ELEMENT_OPTION 0x22
#define ELEMENT_TEXTAREA 0x23
#define ELEMENT_HEADER 0x24
#define ELEMENT_FOOTER 0x25
#define ELEMENT_NAV 0x26
#define ELEMENT_SECTION 0x27
#define ELEMENT_ARTICLE 0x28
#define ELEMENT_ASIDE 0x29
#define ELEMENT_MAIN 0x2A
#define ELEMENT_FIGURE 0x2B
#define ELEMENT_FIGCAPTION 0x2C
#define ELEMENT_VIDEO 0x2D
#define ELEMENT_AUDIO 0x2E
#define ELEMENT_CANVAS 0x2F
#define ELEMENT_SVG 0x30
// etc...
>>
>>108718021
why not
(html
(head
(title "Page Title"))
(body
(h1 "Heading")
(p "Paragraph"))))

??
>>
>>108718231
Oh, I was just joking ._.
>>
>>108721115
let me introduce you to
https://json5.org/
>>
>>108725950
Niggerlicious. Dude, it still using commas. JSON is a single-entry single-value map, 1 to 1 map, there's no need for commas or a separator token other than whitespace.
>>
>>108718021
So....JSON?
>>
Why retards can't understand something so simple as >>108726018 this.
>>
>>108718021
why are backend fags like this? Just stay in your lane and never touch the frontend please
>>
web should be entirely just an extended version of markdown.
>>
>>108721542
If you have that much indentation on a modern webpage, then you're doing it wrong.
>>
>>108718231
>>108722393
>>108725909
Dios mio...
>>
>>108718231
Perfection
>>
>>108718038
but isnt compression solved pure text bloat
>>
>>108718171
nice
>>
>>108718021
Imagine how many exploits could have been avoided if every content and value string came with a length.
>>
let's just create a low level graphics api, like webgl but better. implement it with webgl first, whatever. when it reaches critical mass, implementations will get optimized until there is no overhead left, which is possible because the api is low level and not terrible
>>
>>108718038
This json looks just about as verbose as any HTML I've seen. Maybe less so given that there aren't any closing tags, just closing curly brackets.
>>
>>108725563
>schemas required
Retard.
CBOR does not require schemas, just like JSON.
If you want to use schemas, then go for ProtoBuf.
>>
>>108718021
isn't that what static generators like hugo and jekyll do anyway?
>>
File: haml.png (36 KB, 1451x560)
36 KB PNG
>>108718021
you could use haml
>>
>>108718021
yes
>>
>>108725563
cbor is superior.
>>
>>108718021
imagine how much more advanced webshitting would be if webshitters learned how to use canvas and webasm.
>>
>>108718021
No.
You retarded zoomers are the reason why tech is going into shit. See thing is that boomers were smart about it make it simple and make it work so anybody can use it.

This piece of shit garbage is pure vomit just like anything zoomers produce just like Rust troon lang that is disgusting in syntax it's disgusting to use and second that it's tried to be used in anything it fails just like fucking cloudflare died because of it. Yuck... fuckers don't touch computers go change genders or whatever but don't touch soft never ever... even hardware thanks.
>>
File: screenshot.png (24 KB, 1088x193)
24 KB PNG
>>108721844
the fact that you didn't include <html> or <body> is proof enough that it doesn't require closing tags, you don't need to pretend to be retarded
>>
This look more difficult than hacking an army



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.