If not PHP, then what?

People always gave Jewsh shit for trying to program infinity never in PHP. If not PHP, then what?
inb4 c/c++
inb4 rust

Attached: 20170704_152501929.jpg (1080x1920, 1.02M)

Other urls found in this thread:

github.com/antirez/sds
learnbchs.org/
marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang/
gitgud.io/LynxChan/LynxChan
eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
gnu.org/software/libmicrohttpd/
en.wikipedia.org/wiki/Plack_(software)
asm32.info/fossil/repo/asmbb/index
github.com/majestrate/nntpchan
code.kfarwell.org/werchan/
github.com/Anoncheg1/diboard
410chan.org/b/
github.com/lattera/glibc/blob/895ef79e04a953cac1493863bcae29ad85657ee1/string/wordcopy.c
gitgud.io/el1372/dietchan
gitgud.io/el1372
github.com/el1372/dietchan
twitter.com/SFWRedditVideos

Gas.

Why not pypy?

Why not C or C++? C and C++ are only unpopular for webshit because most websites are created by incompetent codemonkeys that can't be trusted with them. All of the important software those websites depend on is written in C or C++. Imageboards are essentially unchanged from what they were 10 years ago. There would be nothing wrong with putting in the extra effort to write one good, stable imageboard software that puts performance over flexibility.

That said Josh's incompetence and poor direction were the root of Next's failure, not PHP itself.

state of web developers

They're unpopular because managing strings in those languages is fucking brain tumor inducing cancer. Any language used for webshit almost certainly has language-level syntax for string manipulation.

And being able to smack strings (and thus, heap allocations) around like they're nothing is no doubt part of why programs written in such languages allocate garbage like crazy.

That doesn't mean you couldn't have a better language for that purpose. But there isn't one and people prefer shit performance over shit programming experience.

Web stuff simply involves manipulating strings a lot when you query shit from databases and assemble the HTML/CSS and use pajeetquery to interact with the page elements etc.

And receive input from the user, which you may need to validate and reformat and shit.

What this guy said. Why not pypy?

The only thing worse than PHP is nodejs, so literary anything else will do.

What about sds for string manipulation in C? It's supposed to be fast as well.
github.com/antirez/sds

You are a meme parrot and have no fucking idea what you are saying.

learnbchs.org/
#include #include #include #include intmain(void){ if (-1 == pledge("stdio", NULL)) err(EXIT_FAILURE, "pledge"); puts("Status: 200 OK\r"); puts("Content-Type: text/html\r"); puts("\r"); puts("Hello, world!\n"); return(EXIT_SUCCESS);}

Attached: CGkwu.jpg (1680x1050, 188.79K)

Zig Forums in a nutshell

not an argument

No one is mentioning Go?
Is Go unpopular here for some reason. I've found Go to be pleasant for webserver junk.

I thought go was only marginally better than scripting languages like perl/PHP/python. I seem to remember it's benchmarks being pretty shit.

CGI frameworks are actually pretty taxing upon a server, starting and stopping programs in memory takes a lot. Much better if you write a program to act as a web server, and then call various functions in memory. I've always wanted a server base written in C that does something like this, but nothing really exists for it.

Also, PHP isn't all that bad, even with zend and what not. What it looses in elegance, it makes up for in speed and scalability. Only node.js and ruby fags like to give it shit.

Attached: 0f3af0d537a71d5ccc0a0186b7d97fe789d53b778068fe1e726cae7aeb836ccc.png (2835x3508, 3.65M)

I've never heard Go described as
Especially referenced to perl and perl-clones. Maybe that was an early version you remember regarding the GC.
Like most thing I guess it would depend on the application though.
Consider:
marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang/
Where the application involves
containing

Go has all the disadvantages of C, then some new ones, and no advantage.
The community is also insane and thinks copy-pasting code with minor changes is better than using libraries.
Also lol no generics so everything ends up using interfaces, aka fancy void pointers.

I agree with that completely. The community is rather shit.
I feel you're a bit misinformed/inexperienced with Go interfaces.

What is fastCGI?

But unless you're using php as an apache module, isn't it using cgi anyway?

That's a pretty big "unless"

I've actually written a shell of multithreaded fastcgi server in C, which is able to parse multipart/form requests, but I haven't gotten further than demonstrating that the form is working. Really, the string manipulation is the hardest part.
==> form.h macros.h multipart_form_parser.h board.c form.c

Is it? Who uses apache anymore? It seems everyone uses nginx. I'm partial to lighttpd, personally.

Python or something similar. The problem isn't that PHP is a scripting language, it's that it is a godawful scripting language. That said, Josh was a complete moron and would have fucked up INFINITY NEXT (trademark) no matter what he was using.


The experts of Zig Forums.

What's godawful about it? I've never used it.

What about the aforementioned fastCGI? Are you saying the only way to run a large site like Zig Forums is with mod_php (or mod_perl) in apache?

Serious answer? Node: gitgud.io/LynxChan/LynxChan

eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

I said fancy for a reason, they're not as insane as casting to void and back but the obvious issue of needing such boilerplate is still there.

Lol hi Steven

Go on then. Show us the imageboard you wrote in x86 assembly. I can't wait to see how many features it has.

Congratulations. You wrote an imageboard and I haven't. Now, what's the next step of your master plan?

How about Kotlin? I haven't used it much but it looks like a promising language. It can be compiled to native binaries through LLVM (beta), Javascript, Web Assembly, and the JVM. When targeting LLVM you can seamlessly call C code and when targeting JVM you can seamlessly call Java code including its standard library.
Using Kotlin with Vert.x looks like a real performance winner.


Wew nothing like jumping to extremes right off the bat. Are you always that easily instigated?

Attached: 9a99e1a3c23a95c4738d2e7f10085d3aa786be71a9dc86cd13cde67e43af2829.png (641x720, 300.25K)

But seriously, how does fastCGI compare to mod_php? Can it be used for a larger site like Zig Forums?

I'm actually writing an imageboard right now with Ruby on Rails. How about that?

gnu.org/software/libmicrohttpd/

i'm going to write an api server using this.
the speed with any major website usually boils down to the database though. most websites exist as a pretty front-end to a database, like 8ch. it doesn't matter how fast your C website is if your database is slow as hell.

Attached: 0de23402b76172a38f6064cf07b93dc5b4ba2046a80a0aefddf5087799634026.png (552x798, 482.55K)

nginx doesn't have all the features and bloat
some of the apache features are useful.

What advantages are there compared to fcgiapp.h?
How much space does the text/html need for the top ~10 boards? 10*10 threads * 50 posts & 500 chars/post gives 2.5MB/board. DB speed is going to matter a lot, if you render the page for each person or save the cached pages, but the top boards could probably have all posts rendered in memory (being saved to db in background), which would make changing the page very cheap, caching the whole page might not even be worth it, since you wouldn't need to rerender anything, just go through a thread structure and dump the posts to the output.

I used mod_perl a long time ago to run an ecomerce site. It worked fine, but it makes the apache processes really big and you end up needing to run a reverse-proxy for static content in front of your app server so it doesn't get overwhelmed.
Also you probably don't need all the functionality that mod_perl provides. FastCGI will do the trick in most cases, and it works with any language you want, so you don't have to use only Perl. But if you are using Perl, you might look into this as it lets you switch between different backends, so you can compare the performance:
en.wikipedia.org/wiki/Plack_(software)

Unironically Go

It does seem to be an area where Go has caught on.

Actually this one seems nice:
asm32.info/fossil/repo/asmbb/index

github.com/majestrate/nntpchan
code.kfarwell.org/werchan/

github.com/Anoncheg1/diboard

faggot

Attached: 1411362511-8225524a9bccf48b9f0f6e80ad591135.jpeg (700x465, 95.56K)

...

Garbage collection is a clear advantage in some domains, and a clear disadvantage in others.

Webshit server stuff is certainly an area where garbage collection isn't unwelcome.

GTFO newfag.

C/C++ ofc.

OPs have been inb4ing since the beginning, despite whiners like you claiming it can't be done.

OP here with my next question. So IIRC. Vichan rebuild the entire site everytime someone posts, which is part of the reason while it scaled so shittily. Whats the right way to do this?

You sure you're not thinking of infinity next?

Cache the HTML. I'm not sure if it's best to hold it in memory or save it to file or database, but the basic idea is to keep it around and just send it as is. Cloudflare might be able to cache it too but don't quote me on that.

For optimal performance only update the html when it has needs to be modified AND someone requests it.

Both, actually. It's my understanding that it was a flaw of vichan that Josh carried over to infinity next.

Maybe I'm misunderstanding. The way I understand it, an user would make a post, then it would get inserted into the database, and all the static html pages would get remade with the new post in the appropriate spot. From what I'm reading that seems to be basically the same as caching static pages. What is my pajeet brain missing? please open bob and show vegana

No, the second part is wrong. The pages that need to be rebuilt would simply be tagged as "needs_to_be_rebuild". You could pretty easily store that kind of flag in memory so it would take almost no computing effort. They only get rebuilt the first time someone requests the page, and then that version replaces the HTML in the cache until it needs to be rebuilt again.

This way even if there's a 100 people shitposting in each thread, the catalog/index pages don't necessarily get updated at all if nobody is viewing them. Even the threads don't need to update if you have a smarter auto-update mechanic. I think cuckchan uses some JSON string to get the latest posts, if you used something like that, people could auto-update the thread and the HTML wouldn't need to update at all until a new user comes in.

Actually, I think vichan rebuilds all the pages when someone posts. That's the naive caching method, but there's usually much more pageviews than posts so it's probably still beneficial to do that than to rebuild the html every time.

Ok, so what about CAPTCHAs? What's the ideal CAPTCHA system like? Don't say, "none." That's not currently realistic. Should an imageboard use something like Textcaptcha? One of those little math problems? Something like Zig Forums's captcha? Should Zig Forums's CAPTCHA be rewritten in C?

Why?
I think it can safely be replaced with spam filters used abundantly in email.

Then you are retarded.

no u

Warped images like Zig Forums's are the most reliable. It's simple and straightforward, relatively quick to type out, and very hard for bots to interpret.

Unless you use the GPU then warping images is precisely the kind of problem C is best for, since it requires a lot of data crunching to warp the pixels.

I am a C hater and I think there woukd be nothing wrong with writing Zig Forums's captcha system in C, as long as it is well written. The way I see it, the program requires no inputs and always processes the same operations, so it would be hard to exploit it if all you could do with the program was running it to generate an image in a folder.

That said, there are a thousand programming languages that are not C and would be as suitable. Anything that's not PHP and even then, it ain't broken, so whatever

...

Faptcha.

Go on. I'm listening.

See: 410chan.org/b/
There used to be /int/ board, which used flagtpcha, but it closed down due to inactivity.

I don't see a faptcha there. Usually it shows a few boobs, butts, etc, and asks you to tell which is which. To make it harder for a machine to learn it could ask you to select flat tits, etc.

Nothing bad with PHP aside from it being legacy (just maintained for really old working websites and they would fucking jump ship if they fucking could), and probably no direction ahead (since it is fucking legacy and meets a lot of problems that are solved by newer langs).
PHP can be super fast - it's not like you have same amount of kikebook users.
Infinity never failed with ugly meme shiny bloated frameworks and many other vectors.
If you're worried about the language be worried first about how the language adapts with severe flaws and performance issues.
File system i/o problems (db nodb), captcha generation (like why would you generate them on the fly, nigger just pre-generate a month's worth).
If you have a big brain you'd do caching gymnastics on how to serve data that are always requested and make everything static for queries so you don't get fucking baph'd in a crappy search textbox (php have shitty workarounds for those exploits but most fail and just implement a slow ass framework to handle all that).

do you even know what you're saying
what is language level syntax for string manipulation? here is what python has (python2 syntax for disambiguity):
asciistr[0]
unicodestr[2]
and "\x41SS" and u"nigg\u00e9rfaggot"
that's about it. syntax aside, everyone who programs in languages "that support strings" have no idea what the fuck they're doing

Unironically Java. Or some other language with static analysis.

As in you don't need to send strings to functions and create temporary strings for every god damned thing.
Newstring = "Hello" ++ Somestring ++ "ヲルド!" ++ Anotherstring.substring(0, 10) ++ (Somenumber * 50);if (Newstring.contains("へっろ")) { Newstring.splice(Newstring.indexOf("へっろ"), "へっろ".length);}

...

yes, maybe for you, my pajeet friend

char Newstring[128];strcpy(Newstring, "Hello");strcat(NewString, Somestring);strcat(NewString, "ヲルド!");strncat(Newstring, Anotherstring, 10);sprintf(strchr(Newstring, '\0'), "%d", Somenumber * 50);char * f;if((f = strstr(Newstring, "へっろ"))){ memmove(f, f+strlen("へっろ"), strlen(f+strlen("へっろ")));}
Wow, so difficult. you might actually have to learn the idioms of the language you're using.

For reference, here's some code from dietchan, written in c:
PRINT(S( " "), HK(upload_size(upload)), S("" "" "" "" "" "" "" ""));
If something is too verbose, write a small library to cover your use case. OpenIB is about 66 megs. dietchan is 147 megs. When you are writing that much code, it pays to spend some of time writing code that makes you write less code.

It's not difficult. It's tedious and fallible, in which even good programmers can fail after 8 hours of work. Of course you will never experience work fatigue because your NEET ass hasn't had to program anything more complicated than a Fizzbuzz in your life.
Go write it in assembky then, faggot.

If you can't see how inconvenient and annoying it is to write all of that shit in comparison, then it's impossible to have this conversation. Plus you made a fixed length array so everything will go to hell if Somestring is longer than 120 or so characters or if you change the other strings or something, you'll have to keep babysitting and analyzing the needs of that stupid array and you'll need to do it constantly all the time everywhere.

I was pretty sure utf8 strings won't work the same way normal strings, but I might've been wrong.

The whole string issue is part of the reason I was considering pypy.

Half the time you know a string will be within a maximum size (eg generated filenames, generated shell commands). If you don't then you need extra code to handle it. Even then, the extra code can be factored pretty easily, so that it only gets written once.
Technically you can't slice a utf8 string, its true. The main operations you're allowed are: concatenating strings, looking for and removing ascii chars. If you look at the way imageboards handle user input though, it all fits into these two categories.
C places a modest burden on the programmer, sure. That burden encourages him to think of more efficient ways to do things. "Do I really need an extra allocation here?", "do I need to create a temporary string, or can I cat it into the buffer directly?", etc. If you want to be less efficient, its quite easy to write inefficient code as well, with similar gains as other languages.

Faptchas fail because they use a small set of images. If you have a clone of *booru then faptchas are a great addition

This is a great example of how string handling in C sucks. Your code had to search for 14 nulls and the strchr and memmove obfuscate what's going on. None of that code checks for overflows. Even Somenumber * 50 can cause undefined behavior unless it's unsigned.

> There's nothing wrong with C as it was originally > designed, > ... bullshite. Since when is it acceptable for a language to incorporate two entirely diverse concepts such as setf and cadr into the same operator (=), ...And what can you say about a language which is largely usedfor processing strings (how much time does Unix spendcomparing characters to zero and adding one to pointers?)but which has no string data type? Can't decide if an arrayis an aggregate or an address? Doesn't know if strings areconstants or variables? Allows them as initializerssometimes but not others?(I realize this does not really address the original topic,but who really cares. "There's nothing wrong with C as itwas originally designed" is a dangerously positive sweepingstatement to be found in a message posted to this list.)

Crystal. It's about as easy to write effective stuff in as Ruby and has Rails tier frameworks while also being incredibly fast.

only a channigger would use kotlin
wasn't that just Kotlin's clone of node.js?

you shouldn't use strings ever when programming anyway. instead your pajeet lazy ass appends a bunch of strings in some retarded way and uses the GC to clean your poo, in a public facing web app (web shotters wont understand the irony)

I'm shocked nobody has suggested Nim. The only argument against it is that it is not as popular as other languages, which is just an awful excuse not to use something.

Wait so you're saying Vim is actually the best language ever made? Why have I not been using it all this time!

also does that meme shit still compile to a string that you pass into the C compiler?

Fine, Ill redo it: asprintf(&Newstring, "%s%s%s%d", "Hello", Somestring, "ヲルド!", Somenumber * 50);-doesn't search for nulls
-always has a big enough buf
-readable af
>memmove obfuscates what's going on char * strmove(char * dest, char * src){ char * tmp = strdup(src); strcpy(dest, tmp); free(tmp); return dest;}If you care

again ヲルド should be ワールド

One annoying thing about that is you have to make changes in two places to concat on one other string.

So have we decided that C is the best language to make a shitposting engine?

For fuck sake.

memmove support intersecting ranges. memmove(dest, src, strlen(str)+1). No fucking allocations. No extra memory write.

Attached: 985a20c63bf7978356e1fdb93439807e835793264ef9a87a41df64e174dac1c3.jpg (850x1200, 233.55K)

No fucking explicit allocations. No explicit memory write. Memmove does create extra buffer.

But still 1 line is better than four.

Self fix.

Attached: 7500c87bcb2dd90c20552a62e5ad3174156dff8bdcc70b70015f0ff2bfc39b36.jpg (850x841, 131.7K)

What's wrong with kotlin? It's better then java and can seamlessly call any java library. Vert.x actually recently added kotlin support. It was focused on java and other JVM languages originally. But yes, it's basically a better node.js that uses real languages and allocates one event loop per core did it scales nicely. It's one of the fastest frameworks available.

Not precisely. See linked for (the better part of) gnus implementation. Look for word_copy_bwd_aligned.
github.com/lattera/glibc/blob/895ef79e04a953cac1493863bcae29ad85657ee1/string/wordcopy.c

...

Yep. I spent the weekend translating dietchan, so anyone wanting to host an imageboard can use that:
gitgud.io/el1372/dietchan
Should also stay any doubts about Cs feasibility for such a project.

gitgud.io/el1372

Attached: Screenshot_2018-09-30_20-55-18.png (1042x433, 26.74K)

Don't know why gitgud is so broken. I stuck it on github instead: github.com/el1372/dietchan

private repo?

Wirthian languages are very underrated