Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why browsers are bloated

Name: Anonymous 2014-07-27 0:20

https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/Scrollbar.cpp
https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/win/ScrollbarThemeWin.cpp
Let's reinvent the fucking scrollbar, which every goddamn platform with a UI already has, and make it behave subtly different from the native one!

Right-click a native scrollbar in some other app:
- Scroll Here
- Top
- Bottom
- Page Up
- Page Down
- Scroll Up
- Scroll Down

Right-click a scrollbar in Chrome:
- Back
- Forward
- Reload
- Save As...
...

Right-click a scrollbar in Firefox and Opera:
Absolutely fucking nothing happens!

What the fuck!? How did these terminally retarded idiots get involved in creating one of the most important pieces of software to the average user?

Name: Cudder !MhMRSATORI 2014-11-12 14:07

>>237
Contribute ideas, not code.

Name: Anonymous 2014-11-12 16:09

>>241
Shalom!

Name: Anonymous 2014-11-12 16:52

>>242
Shalom!

Name: Anonymous 2014-11-12 19:15

>>243
check 'em

Name: Anonymous 2014-11-12 20:34

>>241
Make it dependently typed, y'all. Embrace the future now. Ain't no dependently typed browser engines out there yet, right?

Name: Anonymous 2014-11-14 18:57

Error 200 OK

Name: Cudder !MhMRSATORI 2014-11-15 2:51

>>245
"dependently typed"? We don't need any of that academic wank abstract bullshite. All that'll do is introduce bloat.

Name: Anonymous 2014-11-15 7:07

>>247
>abstract
Shalom!

Name: Anonymous 2014-11-15 8:27

>>247
Actually, dependent types help reduce bloat. For instance, runtime array bounds checks become obsolete, which can lead to 10-20% of performance improvement.

Name: Anonymous 2014-11-15 12:13

>>249
runtime array bounds checks
Most of these are used by shitty programmers. You don't need them.

Name: Anonymous 2014-11-15 12:16

>>250
Most of them are baked into most compilers.

Name: Anonymous 2014-11-15 20:11

>>251
The only respectible languages are C and assembly.

Name: Anonymous 2014-11-15 20:16

>>252
no generics
respectable
LOL.

Name: Anonymous 2014-11-15 20:18

>>253
Define "generics" and explain why would I need them.

Name: Anonymous 2014-11-15 20:23

>>254
Duckduckgo it.

Name: Anonymous 2014-11-15 20:45

>>253
Fuck yeah C has generics. And real macros.

https://github.com/eudoxia0/cmacro

Name: Anonymous 2014-11-15 21:02

>>255
There is a reason you are being asked about your definition. DDG can't show what you believe.

Name: Anonymous 2014-11-16 7:27

>>257
Define a container that can hold several types of elements.
Define a fold function that works on several types of containers.
Can C do that without C "macros"?

Name: >>6 2014-11-16 9:25

>>258
Define a container that can hold several types of elements.
Like struct (and maybe with a enum "tag" and a union if you want to save space) or a void *.

Define a fold function that works on several types of containers.
http://bbs.progrider.org/prog/read/1403675318/10
Surely there are more examples.

Can C do that without C "macros"?
Yes as you can see.

Name: >>259 2014-11-16 9:26

I am not >>6, I have no idea how that >>6 was there.

Name: Anonymous 2014-11-16 9:48

>>259
int fn(void *, void *)
No automatic dispatch on the type of the container. Also, type-unsafe shit. Might as well use Lisp instead.

Name: Anonymous 2014-11-16 9:50

>>259
Also:
if (fn(&bp[i * size], arg) == 0)
bp[i * size]
This implies that the container is indexable and, what's worse, contigious. How are you going to fold/map a tree then? C is useless.

Name: L. A. Calculus !jYCj6s4P.g 2014-11-16 10:10

>>261,262

No automatic dispatch ...
DIS AINT UR FUCKIN TAXI SERVICE YA FLASHY PANTS RETOID, DIS IS PROGRAMMIN. IF U CANT HANDLE IT, GO RUN CRYIN 2 MOMMY

This implies that the container is indexable and, what's worse, contigious. How are you going to fold/map a tree then? C is useless.
ARRAYS R DA DATATYPE OF C. IF UR EVEN THINKIN ABOUT DOING UR FLASHY GOOTCHY FUNCTIONAL PROGRAMMIN SHIT WITH UR CUTE TREES N BUSHES U SHUD STAY DA FUCK AWAY FROM C N GO BAK TO BITCHING WITH DA OTHER LADIES ON ##programming ABOUT WICH LANGUAGE IS DA MOST /fa/

N STOP ASKIN TEENAGE GIRLS 2 DO DISGUSTIN SHIT, YA FUCKIN POOP SCOOPING RETOID. ALL DEY WANT IS A RIDE HOME, NOT TO FULFILL UR DISGUSTING KAWAII SAFARI HENTAI FETISHES.

Name: L. A. Calculus !jYCj6s4P.g 2014-11-16 10:11

O YEA, N GET DA FUK OUTTA MY THRED

Name: Anonymous 2014-11-16 10:19

>>262
You can easily modify it to work with any data structure.

Name: Anonymous 2014-11-16 10:59

>>263
Actually, even C++ has std::accumulate which is a generic fold. And C++ is hardcore, painful Sado-Masochistic programming just like you love. So C is a useless archaism even among the imperative posse. You should retire and watch Santa Barbara, gramps, not read the internet.

>>265
No, I can't.

Name: Anonymous 2014-11-16 11:03

>>266
Well, you can't, but other people can.

Name: Anonymous 2014-11-16 12:04

>>267
Only via macros which are bug-ridden, ad hoc implementation of generics.

Name: Anonymous 2014-11-16 16:16

You might be interested in this for your HTML engine:

https://ocharles.org.uk/blog/posts/2014-11-11-memo-html.html

Self-Memoizing HTML Rendering via Mutually Recursive Data Types

Name: Anonymous 2014-11-16 16:57

>>111
>>222
LUDICROUS TRIPS

Also sweet hexadecimal dubs, >>255-san, >>256-san.

Name: Anonymous 2014-11-16 19:01

>>262
You'd have to write a map function for trees (as you would for C++). Fold can be done using the visitor pattern.

Name: Anonymous 2014-11-16 19:38

>>271
So it would be a separate function specifically for trees? C is useless.

Name: Anonymous 2014-11-16 20:50

>>272
So you want to call a function but you don't want to know which one you're going to call?

Name: Anonymous 2014-11-16 20:50

>>272
Everybody uses C. Huskel? Who's that?

Name: Anonymous 2014-11-16 21:14

>>271
visitor pattern
Shalom!

Name: Anonymous 2014-11-16 21:26

>>262
Pass another function pointer as argument that each time it is called it will show the next element to be folded.

Name: Anonymous 2014-11-16 22:16

>>272
It's also a separate function in C++. They just look the same when you call it.

Name: Cudder !MhMRSATORI 2014-11-17 12:49

>>258-277
Traversing an array and calling a function on each element is something like ~5 bytes for the main loop:
array_fold_loop:
lodsd
call ebx
loop array_fold_loop


Calling a function is already 5 bytes, and then you still have to setup the parameters for it, so it's smaller and faster to just write the loop directly.

Traversing a binary tree (pre-order, nodes stored as [data, left, right]) is a bit less than 32 bytes, so it does make some sense to have this be a separate function if you're going to use it more than once:
tree_fold:
lodsd
call ebx
lodsd
test eax, eax
jz no_left
push esi
mov esi, eax
call tree_fold
pop esi
no_left:
lodsd
test eax, eax
jnz has_right
ret
has_right:
mov esi, eax
jmp tree_fold


But the tree structures I'm using for DOM/rendering can be traversed non-recursively, see http://bbs.progrider.org/prog/read/1406427616

>>269
All that looks like it's doing is essentially caching the results of rendering each subtree, which is not anything interesting.

One thing that I don’t yet understand though, is how this plays out with memory usage.
Oblivious dumbfuck... this is why software is so fucking bloated!

Name: Anonymous 2014-11-17 12:53

>>278
>bytes
Shalom!

Name: Anonymous 2014-11-17 17:49

>>272
I want to say fold(container) and have it work, no matter what type "container" is or the type of its elements is. That's fucking generics, if you didn't know: being able to define generic functions, functions that work on general stuff, not just on specific types.

>>277
If the call is the same, then that's one generic function with lots of instances. It's the same in Common Lisp, Haskell and any decent language. But if you have to waste your time on shit like fold_rbtree_double (as in C), then that's not generic, it's useless.

>>278
bytes
bytes
bytes
Programmers don't give a shit about "bytes", "bits", "cycles" or any of that sewer infrastructure that has the honor of running programs. Because wasting time on floor-scrubbery means having less time to actually write useful programs.

Newer Posts