9 ms·
BCHS stack – BSD, C, httpd, SQLite
- Numberwang 9y agoI feel this is a bit light on information. What exactly are the big benefits of this?
- doktrin 9y ago> BCHS (pronounced /biːtʃəz/, beaches) is for real development. It's a hipster-free, open source software stack for web applications. > Why C? fewer hipsters : hipsters dislike memory managment Is this meant to be ironic? Spinning up web apps with C in 2017 seems like a supremely hipster thing to do.
- tacostakohashi 9y agoPretty much. I spent a year of my life maintaining a web app written in C circa 2002. Even then, it was a supreme pain as compared to Perl or PHP.
- ams6110 9y agoAt about that time I knew a guy who insisted that the best web dev platform was AOLServer with application code written in C.
- liveoneggs 9y agoAOLServer + TCL was pretty slick
- jrapdx3 9y agoYes indeed, oldies but goodies. This combo is still available and maintained, well, at least in the form of naviserver. Tcl of course has continued in active development and as useful as ever. https://bitbucket.org/naviserver/naviserver/ https://bitbucket.org/naviserver/naviserver/ http://tcl.wiki/ http://tcl.wiki/
- deleted 9y ago[deleted]
- pjmlp 9y agoI worked on a startup that had an AOLServer kind of clone, it was wonderful. However in our case only the DB drivers and Apache TCL module were written in C, everything else was pure TCL.
- tvaughan 9y agoThose were days. https://books.google.cl/books?id=AS81GLj403kC&lpg=PA113&ots=cvIP74yMep&pg=PA106#v=onepage&q&f=false https://books.google.cl/books?id=AS81GLj403kC&lpg=PA113&ots=...
- setq 9y agoBack in 1999 I managed a similar thing written in C with flat file storage. The whole tool chain chucked out a static binary and a directory full of templates and you just cp'ed it to the target and restarted the process. When I look back I've got to be honest and say that it was actually a thing of beauty. The heavy lifting required for some core functions was quite bad but the whole thing pales in comparison to some of the enterprise and microservice based c# behemoths I have looked after since which require literally hours of head scratching to deliver a simple change. I'd rather spend that time writing C than scratching my head. I'd have a lot more hair now.
- liveoneggs 9y agoyou can duplicate that experience with go web dev today! :)
- setq 9y agoI have actually tried that and you're right. The whole experience made me consider going back to electrical engineering when I realised that the status quo hadn't improved in 20 years :)
- walterbell 9y agoHave you looked at Lua+C and LuaJIT+nginx (CloudFlare, OpenResty)? Work is underway to compile a subset of Perl6 to LuaJIT+nginx.
- setq 9y agoI can't get over the 1 based indexes in Lua, unless that has changed in recent years.
- walterbell 9y agoStill there :) The trade-off is rapid development (interpreted, GC), fast execution (JIT faster than Javascript) and easy interfacing to C libraries.
- nothrabannosir 9y agoNot to mention hiding acronym jokes behind IPA.
- mhh__ 9y agoUsing C is just plain dumb these days. I would have thought that avoiding memory safety bugs is worth the price of some "hipsters". Edit: it would appear to be ironic
- RUTHLESS_RUFUS 9y agoFound the guy for whom C was too intimidating!
- mhh__ 9y agoWell I can program in assembler if that pleases you, oh blessed dmr prophet. C is simply not worth using unless you have to due to existing constraints etc.
- ziikutv 9y agoYeap. Additionally, having a name without vowels and pronouncing it as if it had vowels is also pretty hipster, mustachioed as they say :)
- justinjlynn 9y agoThey hated hipsters before it was cool.
- walshemj 9y agoA Real hipster programmer would use Fortran (and use arithmetic if statements) or PL1/G if they are lazy and want to handle text better.
- strictfp 9y agoThe hipster culture is the culture of counter-culture. A hipster aware of their hipsterness would therefore violate their internal value system. So yes, it's hipster thing. But the hipster is not aware. Or is at least pretending not to be aware.
- justbaker 9y agoTrendster vs hipster is a thing now. I think I don't keep up with the trends anymore. But yeah next step we use assembly.
- Teknoman117 9y agoWebAssembly is a thing...
- e12e 9y agoPlease see this handy flowchart: http://pics.blameitonthevoices.com/102011/small_are%20you%20a%20hipster%20flowchart.jpg http://pics.blameitonthevoices.com/102011/small_are%20you%20...
- Nokinside 9y agoThat's hardcore web server stack.
- PythonicAlpha 9y agoThe example is a little to thin, to explain, what is great about it. Currently, I don't see, why I should use it, except going at least ten years into the past. SQLite is great, but I can use it with other useful tools instead of a naked web server.
- KirinDave 9y agoShipping C? To avoid "hipsters". Dear Kristaps, please stop pushing your religion on other people like it's sound engineering practice. If by "hipster" you mean, "People who are sick and tired of shipping insecure software that violates consumer trust and has tends to case downtime" then by all means, ship C code that handles untrusted input. I think it's criminal to propose this without massive auditing, which is what HLL runtimes end up getting.
- nwmcsween 9y agoDo you understand how BCHS works? Obviously not otherwise you wouldn't have made this comment.
- KirinDave 9y agoWhat, exactly, do you think OpenBSD can do to prevent an attacker from comrpimising your responder binary's logic that everyone else isn't already doing? OpenBSD's sandboxing model is superb, but that's not what I'm criticising. C is a bad choice for handling untrusted input precisely because it makes it very difficult to prevent logic errors that disclose user data in unexpected ways. The security community has done its best to prevent the even more disastrous class of breakout errors that comprimise the entire resource (and OpenBSD is great for this, way better than containers). But as my comment was specifically addressed at the choice of C, I don't feel like I need to sweet talk an OS I already say lots of nice things about. Maybe you'd like to respond with all sorts of great literature about how the C spec is not full of holes and gotchas? And don't even get me started on that "simple example binary."
- clarry 9y ago> it makes it very difficult to prevent logic errors that disclose user data in unexpected ways Oh that's a new one. But now that you mention it, I'm starting to recall all the operators that will fprintf the contents of ~/.ssh/ to the network socket upon misuse. Wouldn't it be nice if we could use a simple assert to test the state and inputs before we proceed to shovel private keys in a totally not privsep'd process handling public, unauthenticated connections. Heck, even a simple condition would do, if we could just return an error and stop further processing when things look bad. But you're right, that kind of code would've been too advanced for 1958 or whenever we got this language...
- azr79 9y agoIs that a joke? I'm not even sure at this point.
- brakmic 9y agoJust tried a whois on this domain's data. There are lots of other domains registered by "Mengzhu Wang": http://domainbigdata.com/nj/7bJvx8m5-fv11P6kSKx6vA http://domainbigdata.com/nj/7bJvx8m5-fv11P6kSKx6vA According to archive.org this page exists since 2015: https://web.archive.org/web/20150701000000*/http://www.learnbchs.org/start.html https://web.archive.org/web/20150701000000*/http://www.learn...
- tgragnato 9y agoYes, the joke is appearently unmaintained. > SQLite is a "self-contained, embeddable, zero-configuration" database. And it's bundled (for now…) with stock OpenBSD. It has been 8 months and 3 weeks since SQLite was removed from OpenBSD base. But if you want to develop your modern and hipster-free webapp, then it's still available in ports!
- TkTech 9y agoThis tool seems to be completely useless. Missed every domain I own and listed dozens of unrelated domains. A first and last name are useless without additional WHOIS fields for confidence, such as postal code, phone, etc... I found 246 Mengzhu Wang's on LinkendIn, over 30 in IT any of which could own some of those domains.
- afghanPower 9y agoThis is such an obvious joke. Chill my friends.
- marvel_boy 9y agoOf course it is.
- sgt 9y agoIt's not obvious - because I bet most of HN is wondering right now. It's not necessarily all wrong to be coding microservices in C - it has been done, and has been done in C++ as well. I like the pledge approach. I would like to see nginx support here instead of just OpenBSD's web server. Perhaps this is because nginx won't work with pledge?
- pjmlp 9y agoThe difference being that C++ offers the language features and standard libraries to write safer code, while C....
- PrimHelios 9y ago>C++ >Safer code Not really. I mean, using vectors and strings is nice, but that's about it for safety. You'll still get a shit-ton of memory leaks which isn't great for long-running web apps.
- pjmlp 9y agoIt seems you haven't updated yourself on C++11, C++14, C++17 best practices. If the code has any explicit new/delete or malloc/free, then something is wrong with the design.
- nickpsecurity 9y agoFor a specific example, iMatix had DSL's that outputted C which they used for high-performance server apps. If doing that for web apps, one would need a web framework for C that the code could call. I believe I've also seen both a C and C++ framework in the past. Both bragged about efficiency with the servers cheap.
- deleted 9y ago[deleted]
- AHTERIX5000 9y agoIt is so easy and fun to write web apps in C. Just remember to test them with tsan/asan/valgrind and run through 2-4 static analyzers + check with couple of fuzzers too! Well I think I'll pass this one and hopefully don't need to maintain such apps in the future.
- nickpsecurity 9y agoPlus Frama-C, model-checkers, concurrency analyzer, CompCert in Coq, Simpl in HOL, symbolic execution in KLEE, path-based testing, and property-based... then it might be good to go. On a capability-secure processor running in a VM in case new classes of attack against C code are discovered Again. ;)
- igk 9y agoWhenever I see c-web devs I get reminded of https://blog.fefe.de/ https://blog.fefe.de/, a blog i used to read. Scroll down to the end/check the faq
- johannes1234321 9y agoI'm still waiting for fefe to write his own kernel ... should work well with dietlibc and gatling
- peatmoss 9y agoDiscussion from a year ago: https://news.ycombinator.com/item?id=11763888 https://news.ycombinator.com/item?id=11763888
- mhh__ 9y agojust a prank bro
- tbirdz 9y agoIt's not a joke, just look at the author's work on the supporting kcgi and kwebapp libraries: https://kristaps.bsd.lv/kcgi/ https://kristaps.bsd.lv/kcgi/ https://github.com/kristapsdz/kcgi https://github.com/kristapsdz/kcgi https://github.com/kristapsdz/kcgi-framework https://github.com/kristapsdz/kcgi-framework https://github.com/kristapsdz/kwebapp https://github.com/kristapsdz/kwebapp
- thehardsphere 9y agoIt's the "anti hipster stack," but it has SQLite, which is one of the most hipster databases there is. Or at least the pool of "hipsters" I know like to pick it for use cases where they haven't considered fully whether or not it's actually going scale.
- slowmovintarget 9y agoOh yeah?!? I see your "beaches" and raise you DIRP for real work. * Debian * Iron ( https://github.com/iron/iron https://github.com/iron/iron ) * Rust * Postgres (Clojure, Redhat, Apache, Postgres is good too)
- deleted 9y ago[deleted]
- MrBuddyCasino 9y agoWhat about Rocket? Is Iron preferable?
- k__ 9y agoWhich one has async IO?
- hobos_delight 9y agoThey are both built on top of Hyper, which I believe now has async io.
- nickpsecurity 9y agoI'll watch you DIRP in the distance and show my hand for future of safe, embedded, web apps: JAWS - JX OS + Ada Web Services https://en.m.wikipedia.org/wiki/JX_(operating_system) https://en.m.wikipedia.org/wiki/JX_(operating_system)
- k__ 9y agohaha, nice. I think it will all be ReasonML. Since it's basically OCaml with more JS-friendly syntax, it will lead the masses of JS devs to OCaml, they will find MirageOS, build their servers with it and no one will need anything else anymore.
- albertoleal 9y agoWhat about: Rust, Ubuntu, Postgres, Hyper
- mankash666 9y agoI'm a firmware developer, have been all my professional life. C is my goto language. Rather than look at this through the lens of an experienced web developer, consider the value it provides to C natives such as I. This is to C devs what the micro bit is to kids learning computing - a starter experience with server side dev
- janci 9y agoDo you want buffer overflow? This is how you get buffer overflow in web apps.
- braeckmansj 9y agoDo you know that you can hack any ATM machine !!! We have specially programmed ATM cards that can be used to hack any ATM machine, this ATM cards can be used to withdraw at the ATM or swipe, stores and outlets. We sell this cards to all our customers and interested buyers worldwide, the cards has a daily withdrawal limit of $5000 in ATM and up to $50,000 spending limit in stores. and also if you in need of any other cyber hacking services, we are here for you at any time any day. Here is our price list for ATM cards: BALANCE PRICE $2,500----------------$150 $5,000----------------$300 $10,000 ------------- $650 $20,000 ------------- $1,200 $35,000 --------------$1,900 $50,000 ------------- $2,700 $100,000------------- $5,200 The price include shipping fees,order now: via email...braeckmansj@outlook.com
- wolfspider 9y agoI don't really have a problem with what is presented here but it seems written in a way to trivialize modern web development. I once used to work with a MFC C and C++ guru as dev manager who would do the same thing yet he could not code a web page. He once claimed he could pick up all my knowledge inside a week and bang out a demo as fast as I could. Challenge accepted- one week later he had a functional button. BSD needs a higher level language with a good dev environment more than ever now. It seems you can't have both without either agreeing to a ton of horrible licensing (Java) or vendor lock in to some degree (KRB5 blob from Microsoft for .NET) or lack of platform support. Swift would be a good match because LLVM support but IBM as maintainer of BlueMix has thrown this squarely to Linux. This stack in a sardonic way is actually better than the other ones I listed for those reasons. It's just needless to throw shade on modern web development in general because how do you think we got in this situation to begin with?
- yellowapple 9y agoSince this is OpenBSD-centric, it's worth mentioning that OpenBSD still ships with Perl (and probably always will unless its package management tools get a rewrite), so a "BPHS" stack is both feasible more-or-less out of the box and at least slightly more sane than trying to use C for web development. If you really need a web development solution that's completely out-of-the-box on OpenBSD (aside from perhaps some third-party Perl packages), you might be able to use a "BPHL" stack (BSD Perl Httpd Ldapd) and use LDAP in place of a general-purpose database. That's probably a horrible idea, but whatever.
- alsadi 9y agoIf we are going to craft a stack involving assembly someone would say that assembly is for the weak and real developers write directly in machine language.